From 7965d331f37f399c8e042718336f76f9d976dcee Mon Sep 17 00:00:00 2001 From: Mikhail Sobolev Date: Wed, 25 Dec 2013 21:05:01 +0200 Subject: [PATCH] do not produce too deep toc for category lists --- hacking/module_formatter.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hacking/module_formatter.py b/hacking/module_formatter.py index 8490a7d432..a6c0cf0eaf 100755 --- a/hacking/module_formatter.py +++ b/hacking/module_formatter.py @@ -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()