changeset 60:db0a5f758831

Make the index output have more distinct major sections.
author Rob Landley <rob@landley.net>
date Tue, 02 Oct 2007 14:01:29 -0500
parents 86151d3b2003
children 3ea83bc83471
files make/indexsections.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/make/indexsections.py	Mon Oct 01 22:41:14 2007 -0500
+++ b/make/indexsections.py	Tue Oct 02 14:01:29 2007 -0500
@@ -10,6 +10,7 @@
   while newdepth < depth:
     sys.stdout.write("%s</ul>\n" % ("  "*depth))
     depth -= 1
+  return depth
 
 def process(data, idx):
   line = data[0].count("\n")
@@ -34,9 +35,10 @@
       secnum[-1] += 1
       secstr = ".".join(map(lambda a: str(a), secnum))
       if idx:
-        adjust_depth(len(spans), depth)
-        depth = len(spans)
-        sys.stdout.write('%s<li><a href="#%s">%s %s</a></li>\n' % ("  "*len(spans),spans[-1],secstr,tag))
+        depth = adjust_depth(len(spans)-1, depth)
+        if depth: style="li"
+        else: style="h2"
+        sys.stdout.write('%s<%s><a href="#%s">%s %s</a></%s>\n' % ("  "*len(spans),style,spans[-1],secstr,tag,style))
       else:
         sys.stdout.write('<h2><a name="%s">%s %s</a></h2>\n' % (spans[-1],secstr,tag))
         sys.stdout.write('<%s>%s' % (i[0], i[1]))