Skip to content

Commit

Permalink
DOC: Hide main TOC in <details>, add site usage instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Jan 18, 2023
1 parent 80d68fb commit 7c90840
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
4 changes: 4 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,7 @@
html_theme = 'insipid'
html_copy_source = False
html_permalinks_icon = '#'

if globals().get('html_theme') == 'insipid':
# This controls optional content in index.rst:
tags.add('insipid')
44 changes: 43 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ see :doc:`custom-formats` for details.

__ https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html

.. raw:: html

<details>
<summary>click here to see full table of contents</summary>

.. toctree::
:maxdepth: 4
:glob:
:hidden:

installation
usage
Expand All @@ -40,3 +44,41 @@ __ https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
.. only:: html

There is also :ref:`/orphan.ipynb`, just for the sake of it.

.. raw:: html

</details>

.. only:: html and insipid

.. admonition:: How To Navigate This Site

Use the *next* and *previous* links at the top and the bottom of each page
to flip through the pages.
Alternatively, you can use the right and left arrow keys
on your keyboard.
Some additional keyboard shortcuts
are provided via the `accesskey feature`__:
:kbd:`n` next,
:kbd:`p` previous,
:kbd:`u` up (= to the parent page),
:kbd:`i` index,
:kbd:`s` search and
:kbd:`m` menu (= open/close sidebar).

__ https://developer.mozilla.org/en-US/docs/
Web/HTML/Global_attributes/accesskey

Click on the `hamburger button`__ in the topbar
to open and close the sidebar.
The width of the sidebar can be adjusted by dragging its border.
Click on the title in the topbar to scroll to the top of the page,
if already at the top, go "up" to the parent page
(eventually ending up on this very page).

__ https://en.wikipedia.org/wiki/Hamburger_button

On *touch-enabled* devices:
Tap at the top of the page to show the topbar (if it was scrolled away);
swipe from the left edge to show the sidebar,
swipe towards the left to hide it.

0 comments on commit 7c90840

Please sign in to comment.