aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-12-23 13:51:38 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-12-23 13:51:38 -0800
commit7323b9b629fdd4b84dda16ebc604b6061b3a96da (patch)
treeaac12b31a56259b6e24887d0f4636757a66bcefd /tools
parent8fa94cb460f5e516b0e57adca33f50a669d51f6c (diff)
makespec.py: Only do two levels in the TOC.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/makespec.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/makespec.py b/tools/makespec.py
index aa75b35..fcd7305 100755
--- a/tools/makespec.py
+++ b/tools/makespec.py
@@ -133,8 +133,9 @@ elif specformat == "html":
template = Template(templatefile.read())
toclines = []
for section in sections:
- indent = ' ' * (section['level'] - 1)
- toclines.append(indent + '* [' + section['number'] + ' ' +
+ if section['level'] <= 2:
+ indent = ' ' * (section['level'] - 1)
+ toclines.append(indent + '* [' + section['number'] + ' ' +
section['contents'] + '](#' + section['ident'] + ')')
toc = '<div id="TOC">\n\n' + '\n'.join(toclines) + '\n\n</div>\n\n'
prog = "cmark --smart"