sphinx-togglebutton

A small sphinx extension to add “toggle button” elements to sections of your page.

Install

pip install sphinx-togglebutton

Then, add the extension to your conf.py:

conf.py
extensions = [
    # ...
    "sphinx_togglebutton",
]

Usage

toggle class

.. image:: https://media.giphy.com/media/FaKV1cVKlVRxC/giphy.gif
    :class: toggle
https://media.giphy.com/media/FaKV1cVKlVRxC/giphy.gif

toggle directive

.. toggle::

    This is a toggled content block!

This is a toggled content block!