| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -227,6 +227,22 @@ def cleanup_trailing_parens(doc, element_names): | |||
| 227 | 227 | queue.append(child) | |
| 228 | 228 | ||
| 229 | 229 | ||
| 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 | + | ||
| 230 | 246 | _token_rx = re.compile(r"[a-zA-Z][a-zA-Z0-9.-]*$") | |
| 231 | 247 | ||
| 232 | 248 | def write_esis(doc, ofp, knownempty): | |
@@ -275,6 +291,7 @@ def convert(ifp, ofp): | |||
| 275 | 291 | }) | |
| 276 | 292 | cleanup_root_text(doc) | |
| 277 | 293 | cleanup_trailing_parens(doc, ["function", "method", "cfunction"]) | |
| 294 | + cleanup_synopses(doc) | ||
| 278 | 295 | # | |
| 279 | 296 | d = {} | |
| 280 | 297 | for gi in p.get_empties(): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments