diff options
author | Marian Beermann <public@enkore.de> | 2017-06-30 17:41:58 +0200 |
---|---|---|
committer | Marian Beermann <public@enkore.de> | 2017-06-30 17:41:58 +0200 |
commit | f6c3d1d2cc38b53ba22f5890890a2d5db868a89d (patch) | |
tree | 16fec77cb5b0ce3c4fff2afbec6d77d9d1181816 | |
parent | 193c1850e4752d54a994adb611bdc0291a805104 (diff) |
docs: no third level toc on command usage pages ("Description", "Examples")
-rw-r--r-- | docs/_templates/globaltoc.html | 12 | ||||
-rw-r--r-- | docs/usage.rst | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/docs/_templates/globaltoc.html b/docs/_templates/globaltoc.html index 7841437c8..d10f5f77f 100644 --- a/docs/_templates/globaltoc.html +++ b/docs/_templates/globaltoc.html @@ -1,6 +1,16 @@ <div class="sidebar-block"> <div class="sidebar-toc"> - {% set toctree = toctree(maxdepth=3, collapse=True, includehidden=True) %} + {# Restrict the sidebar toc depth to two levels while generating command usage pages. + This avoids superfluous entries for each "Description" and "Examples" heading. #} + {% if pagename.startswith("usage/") and pagename not in ( + "usage/general", "usage/help", "usage/debug", "usage/notes", + ) %} + {% set maxdepth = 2 %} + {% else %} + {% set maxdepth = 3 %} + {% endif %} + + {% set toctree = toctree(maxdepth=maxdepth, collapse=True) %} {% if toctree %} {{ toctree }} {% else %} diff --git a/docs/usage.rst b/docs/usage.rst index 4f0419b49..de335c1c0 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -31,8 +31,6 @@ Usage </script> .. toctree:: - :hidden: - usage/general usage/init |