Using a toggle button#

The sphinx-togglebutton extension allows text to be hidden.

Colapse warnings, admonitions,…#

This code…

.. admonition:: Click the title to toggle
   :class: dropdown

This title was made into a dropdown admonition by adding `:class: dropdown` to it.

… creates this result:

Toggle text#

This is a toggled content block!

This is the code (also hidden in a toggle…):

..  toggle::

    This is a toggled content block!

Hidding a long table#

Long tables make the documents akward to read.

Let’s test with a short table:

Table 7 User list#

First name

Last name

John

Doe

Jane

Dove

Let’s check if they can be hidden using toggle:

Table 8 User list#

First name

Last name

John

Doe

Jane

Dove

To show a different text, we need to use an admonition with a caption:

The admonition caption can even reference something in the hidden content, using numref and ref in the caption of the admonition but it becomes too convoluted…

Caution

Search for collapsible tables?

Can :class: dropdown be applied to normal tables?

No. Not directly. To be continued when time allows.