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:
commit
5cdd0294c0
2 changed files with 11 additions and 3 deletions
12
docs/_templates/globaltoc.html
vendored
12
docs/_templates/globaltoc.html
vendored
|
@ -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 %}
|
||||
|
|
|
@ -31,8 +31,6 @@ Usage
|
|||
</script>
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
usage/general
|
||||
|
||||
usage/init
|
||||
|
|
Loading…
Reference in a new issue