summaryrefslogtreecommitdiff
path: root/doc/mkhtml.py
diff options
context:
space:
mode:
authorscoder <none@none>2008-04-25 11:07:41 +0200
committerscoder <none@none>2008-04-25 11:07:41 +0200
commit14e5e6807e7f35830645f15ebe8260c844723b1d (patch)
tree632d2505f794e67f11e56effbdb909c44df84acc /doc/mkhtml.py
parent5dd0b01f88a727c2d4ffecca5974843a2cb23491 (diff)
downloadpython-lxml-14e5e6807e7f35830645f15ebe8260c844723b1d.tar.gz
[svn r3600] r4086@delle: sbehnel | 2008-04-25 11:06:16 +0200
HTML doc link fixes --HG-- branch : trunk
Diffstat (limited to 'doc/mkhtml.py')
-rw-r--r--doc/mkhtml.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/mkhtml.py b/doc/mkhtml.py
index 19eb44f0..ca0ea4d6 100644
--- a/doc/mkhtml.py
+++ b/doc/mkhtml.py
@@ -17,6 +17,7 @@ find_headings = XPath("//h:h1[not(@class)]/h:a/text()", namespaces=htmlnsmap)
find_menu = XPath("//h:ul[@id=$name]", namespaces=htmlnsmap)
find_page_end = XPath("/h:html/h:body/h:div[last()]", namespaces=htmlnsmap)
+find_words = re.compile('(\w+)').findall
replace_invalid = re.compile(r'[-_/.\s\\]').sub
def make_menu_section_head(section, menuroot):
@@ -51,7 +52,7 @@ def build_menu_entry(page_title, url, section_head, headings=None):
subul = SubElement(title, "ul", {"class":"submenu"})
for heading in headings:
li = SubElement(subul, "li", {"class":"menu item"})
- ref = replace_invalid('-', heading.lower())
+ ref = '-'.join(find_words(heading.lower()))
a = SubElement(li, "a", href=url+'#'+ref)
a.text = heading