From 661145c137e4159859663e047d4890b132203a42 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 20 Nov 2010 21:14:52 -0500 Subject: Get id attributes into the .px files so they'll be in the HTML so links into documents will work right. --- doc/_ext/px_xlator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/_ext/px_xlator.py b/doc/_ext/px_xlator.py index 00cc854e..f4ddc101 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): -- cgit v1.2.1