sphinx-togglebutton¶
A small sphinx extension to add “toggle button” elements to sections of your page.
Documentation: https://sphinx-togglebutton.readthedocs.io/
Source Code: https://github.com/executablebooks/sphinx-togglebutton
Install¶
pip install sphinx-togglebutton
Then, add the extension to your conf.py
:
conf.py¶
extensions = [
# ...
"sphinx_togglebutton",
]
Usage¶
dropdown
for admonitions¶
.. admonition:: Click the title to toggle
:class: dropdown
This title was made into a dropdown admonition by adding ``:class: dropdown`` to it.
Click the title to toggle
This title was made into a dropdown admonition by adding :class: dropdown
to it.
Benchmark
bench.py¶
print("Hello, world!")
toggle
class¶
.. image:: https://media.giphy.com/media/FaKV1cVKlVRxC/giphy.gif
:class: toggle

toggle
directive¶
.. toggle::
This is a toggled content block!
This is a toggled content block!
Tip
The toggle directive can also be nested. For example:
.. tip::
The toggle directive can also be nested. For example:
.. toggle::
This is a toggled content block!