Skip to main content

The sphinx-collapse extension enhances Sphinx documentation by introducing collapsible sections. This feature allows documentation authors to create toggles for hiding and revealing detailed content, making documents more manageable and navigable for readers.

Example:

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

Add the collapse directive in your reStructuredText content. Here’s a basic example:

..  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.

Example output:

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.

Metadata

Release files for sphinx_collapse 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx_collapse 0.1.4
File Size Uploaded
sphinx_collapse-0.1.4.tar.gz 19.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx_collapse 0.1.4
File Interpreter ABI Platform
sphinx_collapse-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 24.2 kB

Release files / sphinx_collapse-0.1.4.tar.gz

Download URL sphinx_collapse-0.1.4.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ba860e50839c026cd1abcc164e1e7cb18bcc11c8214150e34a6550461be3229f
BLAKE2b-256 checksum
How to use checksums
14a1cb5bb03a5081bd1229b3296c2af347b4147017fdb62777d2aad855cd349f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.5

Release files / sphinx_collapse-0.1.4-py3-none-any.whl

Download URL sphinx_collapse-0.1.4-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76e9fa531bafb4984d6ef5f3dbe311982837f5965b7a35eda013bbd9dd41445e
BLAKE2b-256 checksum
How to use checksums
9a18277f4663c97073606917becab629938237f1e03952f4e339f8b7d1f3096b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.5

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page