Sphinx Toggle Button

0.4.5 · active · verified Tue Apr 14

Sphinx Toggle Button is a Sphinx extension that enables users to add toggle functionality to documentation, allowing them to collapse or expand sections of content and admonitions. The library is actively maintained, with frequent patch releases addressing fixes and minor releases introducing new features. The current version is 0.4.5.

Warnings

Install

Imports

Quickstart

To enable sphinx-togglebutton, add 'sphinx_togglebutton' to the `extensions` list in your Sphinx project's `conf.py` file. Once enabled, you can make admonitions collapsible by adding `:class: dropdown` to them, or hide arbitrary blocks of content using the `.. toggle::` directive.

# conf.py
extensions = [
    'sphinx_togglebutton',
    # ... other extensions
]

# example.rst or example.md

.. note:: Click to toggle
   :class: dropdown

   This content is initially hidden and can be toggled by clicking the admonition title.


.. toggle:: Show/Hide Arbitrary Content

   This entire block of content, including paragraphs and other directives,
   will be hidden behind a toggle button.

   - Item 1
   - Item 2

view raw JSON →