summaryrefslogtreecommitdiffstats
path: root/docs/_templates/globaltoc.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/_templates/globaltoc.html')
-rw-r--r--docs/_templates/globaltoc.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/_templates/globaltoc.html b/docs/_templates/globaltoc.html
new file mode 100644
index 000000000..d10f5f77f
--- /dev/null
+++ b/docs/_templates/globaltoc.html
@@ -0,0 +1,20 @@
+<div class="sidebar-block">
+ <div class="sidebar-toc">
+ {# 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 %}
+ {{ toc }}
+ {% endif %}
+ </div>
+</div>