From 25429bcdf4b9b53154f62cc0257c954e703be442 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sun, 28 Jun 2009 16:17:28 +0300 Subject: [PATCH] devhelp: produce better index term sub-items --- sphinx/builders/devhelp.py | 8 ++++++-- 1 file 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: