summaryrefslogtreecommitdiff
path: root/sphinx/builders/devhelp.py
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2009-06-28 16:17:28 +0300
committerPauli Virtanen <pav@iki.fi>2009-06-28 16:17:28 +0300
commit25429bcdf4b9b53154f62cc0257c954e703be442 (patch)
treebee96db01e011758a50ad7043838b2e613ed15bc /sphinx/builders/devhelp.py
parent8122339c950c857e58098b442fe309794488318f (diff)
downloadsphinx-git-25429bcdf4b9b53154f62cc0257c954e703be442.tar.gz
devhelp: produce better index term sub-items
Diffstat (limited to 'sphinx/builders/devhelp.py')
-rw-r--r--sphinx/builders/devhelp.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/sphinx/builders/devhelp.py b/sphinx/builders/devhelp.py
index ba117e622..c648bd27c 100644
--- a/sphinx/builders/devhelp.py
+++ b/sphinx/builders/devhelp.py
@@ -12,6 +12,7 @@
"""
import os
+import re
import cgi
import sys
from os import path
@@ -114,11 +115,14 @@ class DevhelpBuilder(StandaloneHTMLBuilder):
else:
for i, ref in enumerate(refs):
etree.SubElement(functions, 'function',
- name="%s [%d]" % (title, i), link=ref)
+ name="[%d] %s" % (i, title),
+ link=ref)
if subitems:
+ parent_title = re.sub(r'\s*\(.*\)\s*$', '', title)
for subitem in subitems:
- write_index(subitem[0], subitem[1], [])
+ write_index("%s %s" % (parent_title, subitem[0]),
+ subitem[1], [])
for (key, group) in index:
for title, (refs, subitems) in group: