Skip to main content

Add a copy button to each of your code cells.

Project description

sphinx-collapse-admonitions

A small sphinx extension to make it possible to collapse admonition blocks (notes, warnings, etc) in Sphinx.

Installation

You can install sphinx-collapse-admonitions with pip:

pip install sphinx-collapse-admonitions

Usage

In your conf.py configuration file, add sphinx_collapse_admonitions to your extensions list. E.g.:

extensions = [
    ...
    'sphinx_collapse_admonitions'
    ...
]

Now, whenever you wish for an admonition to be collapsed, add the following key:val pair to the directive that you use: :class: collapsed.

For example, this code would create a collapsed "note" admonition:

.. note::
    :class: collapsed

    This is my note.

If you'd like to choose your own admonition text, use the admonition directive on its own:

.. admonition:: This is my admonition title
    :class: collapsed

    This is the admonition body, it will be hidden.

Clicking on the title section of the collapsed admonition will toggle the body's visibility.

Project details


Release history Release notifications

This version

0.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sphinx-collapse-admonitions, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size sphinx_collapse_admonitions-0.0.1-py3-none-any.whl (7.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size sphinx-collapse-admonitions-0.0.1.tar.gz (6.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page