Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fba0ba2

Browse files
committed
Added a transform to start cleaning up the modulesynopsis stuff a
little; more thinking is needed about what we really want.
1 parent e9e0596 commit fba0ba2

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Doc/tools/sgmlconv/docfixer.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,22 @@ def cleanup_trailing_parens(doc, element_names):
227227
queue.append(child)
228228

229229

230+
def cleanup_synopses(doc):
231+
# Actually, this should build a "moduleinfo" element from various
232+
# parts of the meta-information in the section. <moduleinfo> needs
233+
# some design work before we can really do anything real.
234+
synopses = doc.getElementsByTagName("modulesynopsis")
235+
for node in synopses:
236+
node._node.name = "synopsis"
237+
parent = node.parentNode
238+
if parent.tagName == "section":
239+
children = parent.childNodes
240+
parent.removeChild(node)
241+
parent.insertBefore(node, children[2])
242+
text = doc.createTextNode("\n ")
243+
parent.insertBefore(text, node)
244+
245+
230246
_token_rx = re.compile(r"[a-zA-Z][a-zA-Z0-9.-]*$")
231247

232248
def write_esis(doc, ofp, knownempty):
@@ -275,6 +291,7 @@ def convert(ifp, ofp):
275291
})
276292
cleanup_root_text(doc)
277293
cleanup_trailing_parens(doc, ["function", "method", "cfunction"])
294+
cleanup_synopses(doc)
278295
#
279296
d = {}
280297
for gi in p.get_empties():

0 commit comments

Comments
 (0)