Commits

Georg Brandl committed bc472f4 Merge

merge with pv

Comments (0)

Files changed (1)

sphinx/builders/devhelp.py

 """
 
 import os
+import re
 import cgi
 import sys
 from os import path
         try:
             import elementtree.ElementTree as etree
         except ImportError:
-            import cElementTree.ElemenTree as etree
+            import cElementTree as etree
 
 try:
     import gzip
             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: