https://github.com/dgarcia360/sphinx-collapse
Sphinx extension to hide large amounts of content
https://github.com/dgarcia360/sphinx-collapse
directive documentation extension sphinx sphinx-doc
Last synced: 10 months ago
JSON representation
Sphinx extension to hide large amounts of content
- Host: GitHub
- URL: https://github.com/dgarcia360/sphinx-collapse
- Owner: dgarcia360
- License: mit
- Created: 2022-01-19T12:32:13.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-26T22:52:18.000Z (about 2 years ago)
- Last Synced: 2024-11-28T20:17:59.231Z (over 1 year ago)
- Topics: directive, documentation, extension, sphinx, sphinx-doc
- Language: Python
- Homepage: https://sphinx-collapse.readthedocs.io
- Size: 41 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE.md
Awesome Lists containing this project
README
sphinx-collapse
===============
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:
.. image:: 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
------------
#. Install ``sphinx-collapse`` using PIP.
.. code-block:: bash
pip install sphinx-collapse
#. Add the extension to your Sphinx project ``conf.py`` file.
.. code-block:: python
extensions = ['sphinx_collapse']
Usage
-----
Add the collapse directive in your reStructuredText content. Here's a basic example:
.. code-block:: rst
.. 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:
.. image:: 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 `_.