summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-11-20 21:14:52 -0500
committerNed Batchelder <ned@nedbatchelder.com>2010-11-20 21:14:52 -0500
commit24567ee88042326542fff3e86c183c63576e64d1 (patch)
tree65a85838a841048cb4ab2dd1ca54d3ab74573978
parent46d02f4305e696500d3fcb93e564a7544379c5f1 (diff)
downloadpython-coveragepy-24567ee88042326542fff3e86c183c63576e64d1.tar.gz
Get id attributes into the .px files so they'll be in the HTML so links into documents will work right.
-rw-r--r--doc/_ext/px_xlator.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/_ext/px_xlator.py b/doc/_ext/px_xlator.py
index 00cc854..f4ddc10 100644
--- a/doc/_ext/px_xlator.py
+++ b/doc/_ext/px_xlator.py
@@ -29,6 +29,10 @@ class PxTranslator(BaseHtmlXlator):
if self.section_level == 1:
raise nodes.SkipNode
else:
+ # The id for the h2 tag is on the parent, move it
+ # down here so we'll get the right HTML.
+ if not node['ids'] and len(node.parent['ids']) > 1:
+ node['ids'] = [node.parent['ids'][1]]
BaseHtmlXlator.visit_title(self, node)
def visit_field_list(self, node):