Skip to content

Commit

Permalink
DOC: add a page with a different sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Dec 29, 2022
1 parent 22754ef commit b38c85b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
6 changes: 5 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@
'separator.html',
'indices.html',
],
'showcase/no-sidebar': [], # To demonstrate a page without a sidebar
'showcase/different-sidebar': [
'localtoc.html',
'searchbox.html',
],
'showcase/no-sidebar': [],
}

html_static_path = ['_static']
Expand Down
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
showcase/math
showcase/api-doc
showcase/sections
showcase/different-sidebar
showcase/no-sidebar

----
Expand Down
31 changes: 31 additions & 0 deletions doc/showcase/different-sidebar.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Page With Different Sidebar
===========================

This page has different content in the sidebar,
see :confval:`html_sidebars` in :download:`conf.py <../conf.py>`:

.. literalinclude:: ../conf.py
:caption: conf.py
:language: python
:linenos:
:lineno-match:
:start-at: html_sidebars
:end-at: }


Local Table of Contents
-----------------------

Instead of displaying the whole TOC in the sidebar
with ``globaltoc.html``,
a local TOC can be shown with ``localtoc.html``.


Search Box
----------

If you don't like the search button in the topbar,
you can also put a search field into the sidebar
by selecting the template ``searchbox.html``.

Like the search button, this is only available when JavaScript is enabled.

0 comments on commit b38c85b

Please sign in to comment.