Skip to content

Commit

Permalink
do not produce too deep toc for category lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Sobolev committed Dec 25, 2013
1 parent af1f8db commit 7965d33
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions hacking/module_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,19 @@ def process_category(category, categories, options, env, template, outputname):
category_header = "%s Modules" % (category.title())
underscores = "`" * len(category_header)

category_file.write(category_header)
category_file.write("\n")
category_file.write(underscores)
category_file.write("\n")
category_file.write(".. toctree::\n")
category_file.write("""\
%s
%s
.. toctree::
:maxdepth: 1
""" % (category_header, underscores))

for module in modules:
result = process_module(module, options, env, template, outputname, module_map)
if result != "SKIPPED":
category_file.write(" %s_module\n" % module)
category_file.write(" %s_module\n" % module)


category_file.close()
Expand Down

0 comments on commit 7965d33

Please sign in to comment.