diff options
author | Fred Drake <fdrake@acm.org> | 1999-08-03 15:32:48 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1999-08-03 15:32:48 (GMT) |
commit | 82ebc27357891ec342b8602fb28189751b8d06e6 (patch) | |
tree | ecc202c417d62d8bc546603e185726b0e2b58b8b /Doc | |
parent | 2f6ec9ca81cd80b5777c8776782f132890eb4773 (diff) | |
download | cpython-82ebc27357891ec342b8602fb28189751b8d06e6.zip cpython-82ebc27357891ec342b8602fb28189751b8d06e6.tar.gz cpython-82ebc27357891ec342b8602fb28189751b8d06e6.tar.bz2 |
remap_element_names(): Only used for things that the new conversion
engine in latex2esis.py can do, so discard it.
paragraph detection & markup: Handle some of the list-like
environments properly, picking up paragraphs inside
list items. (Only changed a few element-sets used for
recognition.)
fixup_refmodindexes_chunk(): Use the right attribute to determine the
module a <ref*modindex/> element is referring to.
convert(): Don't call remap_element_names(); it was removed.
Diffstat (limited to 'Doc')
-rwxr-xr-x | Doc/tools/sgmlconv/docfixer.py | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/Doc/tools/sgmlconv/docfixer.py b/Doc/tools/sgmlconv/docfixer.py index 983601b..43959e2 100755 --- a/Doc/tools/sgmlconv/docfixer.py +++ b/Doc/tools/sgmlconv/docfixer.py @@ -526,26 +526,7 @@ def cleanup_synopses(doc, fragment): create_module_info(doc, node) -def remap_element_names(root, name_map): - queue = [] - for child in root.childNodes: - if child.nodeType == ELEMENT: - queue.append(child) - while queue: - node = queue.pop() - tagName = node.tagName - if name_map.has_key(tagName): - name, attrs = name_map[tagName] - node._node.name = name - for attr, value in attrs.items(): - node.setAttribute(attr, value) - for child in node.childNodes: - if child.nodeType == ELEMENT: - queue.append(child) - - def fixup_table_structures(doc, fragment): - # must be done after remap_element_names(), or the tables won't be found for table in find_all_elements(fragment, "table"): fixup_table(doc, table) @@ -628,6 +609,8 @@ RECURSE_INTO_PARA_CONTAINERS = ( "section", "subsection", "subsubsection", "paragraph", "subparagraph", "back-matter", "howto", "manual", + "item", "itemize", "fulllineitems", "enumeration", "descriptionlist", + "definitionlist", "definition", ) PARA_LEVEL_ELEMENTS = ( @@ -637,16 +620,16 @@ PARA_LEVEL_ELEMENTS = ( "funcdesc", "methoddesc", "excdesc", "memberdesc", "membderdescni", "funcdescni", "methoddescni", "excdescni", "tableii", "tableiii", "tableiv", "localmoduletable", - "sectionauthor", "seealso", + "sectionauthor", "seealso", "itemize", # include <para>, so we can just do it again to get subsequent paras: PARA_ELEMENT, ) PARA_LEVEL_PRECEEDERS = ( - "index", "indexii", "indexiii", "indexiv", "setindexsubitem", + "setindexsubitem", "stindex", "obindex", "COMMENT", "label", "input", "title", "versionadded", "versionchanged", "declaremodule", "modulesynopsis", - "moduleauthor", "indexterm", + "moduleauthor", "indexterm", "leader", ) @@ -884,7 +867,7 @@ def fixup_refmodindexes_chunk(container): ewrite(entry.toxml() + "\n") continue found = 0 - module_name = entry.getAttribute("name") + module_name = entry.getAttribute("module") for node in module_entries: if len(node.childNodes) != 1: continue @@ -986,15 +969,6 @@ def convert(ifp, ofp): normalize(fragment) fixup_paras(doc, fragment) fixup_sectionauthors(doc, fragment) - remap_element_names(fragment, { - "tableii": ("table", {"cols": "2"}), - "tableiii": ("table", {"cols": "3"}), - "tableiv": ("table", {"cols": "4"}), - "lineii": ("row", {}), - "lineiii": ("row", {}), - "lineiv": ("row", {}), - "refmodule": ("module", {"link": "link"}), - }) fixup_table_structures(doc, fragment) fixup_rfc_references(doc, fragment) fixup_signatures(doc, fragment) |