Skip to main content

Collapse extension for Sphinx.

Project description

sphinx-collapse is a Sphinx extension that lets you add collapsible content to your documentation.

Collapsibles are useful to hide large amounts of content:

https://raw.githubusercontent.com/dgarcia360/sphinx-collapse/main/docs/source/_static/example.png

Features

Hide content

Toggle the visibility of content with a Sphinx directive tailored for this purpose.

Minimal code

The library does not use JavaScript nor relies on third-party frameworks such as Bootstrap, Tailwind CSS, or Foundation.

Configurable

Customize the style of the collapsible directive using options or overriding the CSS.

Installation

  1. Install sphinx-collapse using PIP.

    pip install sphinx-collapse
  2. Add the extension to your Sphinx project conf.py file.

    extensions = ['sphinx_collapse']

Usage

Using the directive:

..  collapse:: Click here

   Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
   Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Renders:

https://raw.githubusercontent.com/dgarcia360/sphinx-collapse/main/docs/source/_static/example.png

Check out the full documentation for more customizable options at https://sphinx-collapse.readthedocs.io/

Contributing

We encourage public contributions! Please review CONTRIBUTING for details on our code of conduct and development process.

License

Copyright (c) 2022 - present David Garcia (@dgarcia360).

Licensed under the MIT License.

Project details


Download files

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

Source Distribution

sphinx_collapse-0.1.3.tar.gz (18.5 kB view hashes)

Uploaded Source

Built Distribution

sphinx_collapse-0.1.3-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page