diff --git a/Doc/conf.py b/Doc/conf.py index e2dff74538a342..e84431aff331cb 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -312,7 +312,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 b57f4b09a5dcb6..95c0083c611f26 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 00000000000000..e93c185019801c --- /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 %} + + + {{ parent.title }} + + +{%- endfor %} +{%- else %} +

+ + {{ docstitle|e }} + +

+{%- endif %} +
+ {{ toc }} +
\ No newline at end of file