diff --git a/Doc/conf.py b/Doc/conf.py index d6f34576715045f..3b9f385337c0d56 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -348,7 +348,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'], } diff --git a/Doc/contents.rst b/Doc/contents.rst index 852be4a6d5b6ba7..3ce57b82f0120d9 100644 --- a/Doc/contents.rst +++ b/Doc/contents.rst @@ -3,6 +3,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .. toctree:: + :maxdepth: 2 whatsnew/index.rst tutorial/index.rst diff --git a/Doc/tools/templates/customlocaltoc.html b/Doc/tools/templates/customlocaltoc.html new file mode 100644 index 000000000000000..4e723ca6e79e61c --- /dev/null +++ b/Doc/tools/templates/customlocaltoc.html @@ -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 +#} +
+
+{%- if parents %} +{%- for parent in parents[-4:] %} + + + {{ parent.title }} + + +{%- endfor %} +{%- else %} +

+ + {{ docstitle|e }} + +

+{%- endif %} +
+ {{ toc }} +