Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
html_sidebars = {
# Defaults taken from https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars
# Removes the quick search block
'**': ['localtoc.html', 'relations.html', 'customsourcelink.html'],
'**': ['customlocaltoc.html', 'relations.html', 'customsourcelink.html'],
'index': ['indexsidebar.html'],
}

Expand Down
1 change: 1 addition & 0 deletions Doc/contents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

.. toctree::
:maxdepth: 2

whatsnew/index.rst
tutorial/index.rst
Expand Down
29 changes: 29 additions & 0 deletions Doc/tools/templates/customlocaltoc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{#
Customization of sphinx's basic/localtoc.html

- When present, display links to the parent pages within sections,
rather than link to the global contents
- When parents are absent, display a link to the document root using the docstitle
#}
<div>
<div>
{%- if parents %}
{%- for parent in parents %}
<h{{ loop.index0 + 3 }}>
<a href="{{ parent.link|e }}"
title="{{ parent.title }}">
{{ parent.title }}
</a>
</h{{ loop.index0 + 3 }}>
{%- endfor %}
{%- else %}
<h3>
<a href="{{ pathto(root_doc)|e }}"
title="{{ docstitle|e }}">
{{ docstitle|e }}
</a>
</h3>
{%- endif %}
</div>
{{ toc }}
</div>
Loading