Skip to main content

Collapse extension for Sphinx.

Project description

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.

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.4.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_collapse-0.1.4-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_collapse-0.1.4.tar.gz.

File metadata

  • Download URL: sphinx_collapse-0.1.4.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.5

File hashes

Hashes for sphinx_collapse-0.1.4.tar.gz
Algorithm Hash digest
SHA256 ba860e50839c026cd1abcc164e1e7cb18bcc11c8214150e34a6550461be3229f
MD5 d8b4824e15f3ee306109e8bdb69afb65
BLAKE2b-256 14a1cb5bb03a5081bd1229b3296c2af347b4147017fdb62777d2aad855cd349f

See more details on using hashes here.

File details

Details for the file sphinx_collapse-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_collapse-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 76e9fa531bafb4984d6ef5f3dbe311982837f5965b7a35eda013bbd9dd41445e
MD5 d066d7845d901b72de01e973534450a2
BLAKE2b-256 9a18277f4663c97073606917becab629938237f1e03952f4e339f8b7d1f3096b

See more details on using hashes here.

Supported by

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