From 7323b9b629fdd4b84dda16ebc604b6061b3a96da Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 23 Dec 2015 13:51:38 -0800 Subject: makespec.py: Only do two levels in the TOC. --- tools/makespec.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tools') 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 = '
\n\n' + '\n'.join(toclines) + '\n\n
\n\n' prog = "cmark --smart" -- cgit v1.2.3