1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-23 14:41:43 +00:00

Merge pull request #2768 from enkore/docs/no-l3toc

docs: no third level toc on command usage pages ("Description", "Examples")
This commit is contained in:
enkore 2017-06-30 17:48:28 +02:00 committed by GitHub
commit 5cdd0294c0
2 changed files with 11 additions and 3 deletions

View file

@ -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 %}

View file

@ -31,8 +31,6 @@ Usage
</script>
.. toctree::
:hidden:
usage/general
usage/init