diff make/indexsections.py @ 40:17389c66eb02

More work on master index skeleton and infrastructure.
author Rob Landley <rob@landley.net>
date Tue, 11 Sep 2007 17:12:19 -0500
parents 6f2dd07a6016
children 4480365c7aef
line wrap: on
line diff
--- a/make/indexsections.py	Tue Sep 11 16:12:59 2007 -0500
+++ b/make/indexsections.py	Tue Sep 11 17:12:19 2007 -0500
@@ -36,11 +36,13 @@
     spans.append("_".join(tag.split()))
     if sys.argv[1] == "-i":
       adjust_depth(len(spans))
-      sys.stdout.write('<li><a href="#%s">%s</a></li>\n' % (spans[-1],tag))
+      sys.stdout.write('%s<li><a href="#%s">%s</a></li>\n' % ("  "*len(spans),spans[-1],tag))
     else:
       sys.stdout.write('<h2><a name="%s">%s</a></h2>\n' % (spans[-1],tag))
       sys.stdout.write('<%s>%s' % (i[0], i[1]))
-  if tag[0] == "/span": spans.pop()
+  elif tag[0] == "/span": spans.pop()
+  else:
+    if sys.argv[1] != '-i': sys.stdout.write('<%s>%s' % (i[0], i[1]));
   line += i[1].count("\n")
 
 if sys.argv[1] == "-i": adjust_depth(0)