summaryrefslogtreecommitdiffstats
path: root/Doc/tools/sgmlconv/docfixer.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-12-10 05:07:09 (GMT)
committerFred Drake <fdrake@acm.org>1998-12-10 05:07:09 (GMT)
commitfba0ba2a6f4ce344de5c3e6f56b579873ca2eb61 (patch)
tree68de7e4e2f00624b588b46b3c1440c3bf4fd0768 /Doc/tools/sgmlconv/docfixer.py
parente9e05968e3229856c050bc86984fd9699fdbc982 (diff)
downloadcpython-fba0ba2a6f4ce344de5c3e6f56b579873ca2eb61.zip
cpython-fba0ba2a6f4ce344de5c3e6f56b579873ca2eb61.tar.gz
cpython-fba0ba2a6f4ce344de5c3e6f56b579873ca2eb61.tar.bz2
Added a transform to start cleaning up the modulesynopsis stuff a
little; more thinking is needed about what we really want.
Diffstat (limited to 'Doc/tools/sgmlconv/docfixer.py')
-rwxr-xr-xDoc/tools/sgmlconv/docfixer.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Doc/tools/sgmlconv/docfixer.py b/Doc/tools/sgmlconv/docfixer.py
index e486c4a..97bcb09 100755
--- a/Doc/tools/sgmlconv/docfixer.py
+++ b/Doc/tools/sgmlconv/docfixer.py
@@ -227,6 +227,22 @@ def cleanup_trailing_parens(doc, element_names):
queue.append(child)
+def cleanup_synopses(doc):
+ # Actually, this should build a "moduleinfo" element from various
+ # parts of the meta-information in the section. <moduleinfo> needs
+ # some design work before we can really do anything real.
+ synopses = doc.getElementsByTagName("modulesynopsis")
+ for node in synopses:
+ node._node.name = "synopsis"
+ parent = node.parentNode
+ if parent.tagName == "section":
+ children = parent.childNodes
+ parent.removeChild(node)
+ parent.insertBefore(node, children[2])
+ text = doc.createTextNode("\n ")
+ parent.insertBefore(text, node)
+
+
_token_rx = re.compile(r"[a-zA-Z][a-zA-Z0-9.-]*$")
def write_esis(doc, ofp, knownempty):
@@ -275,6 +291,7 @@ def convert(ifp, ofp):
})
cleanup_root_text(doc)
cleanup_trailing_parens(doc, ["function", "method", "cfunction"])
+ cleanup_synopses(doc)
#
d = {}
for gi in p.get_empties():