diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-12-23 13:51:38 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-12-23 13:51:38 -0800 |
commit | 7323b9b629fdd4b84dda16ebc604b6061b3a96da (patch) | |
tree | aac12b31a56259b6e24887d0f4636757a66bcefd | |
parent | 8fa94cb460f5e516b0e57adca33f50a669d51f6c (diff) |
makespec.py: Only do two levels in the TOC.
-rwxr-xr-x | tools/makespec.py | 5 |
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" |