Skip to content

sphinx-toolbox/html-section

Repository files navigation

html-section

Sphinx extension to hide section headers with non-HTML builders.

Tests Linux Test Status Windows Test Status macOS Test Status Coverage
PyPI PyPI - Package Version PyPI - Supported Python Versions PyPI - Supported Implementations PyPI - Wheel
Activity GitHub last commit GitHub commits since tagged version Maintenance PyPI - Downloads
QA CodeFactor Grade Flake8 Status mypy status
Other License GitHub top language Requirements Status

Installation

html-section can be installed from PyPI.

To install with pip:

$ python -m pip install html-section

Then enable the extension by adding the following to your conf.py file:

extensions = [
                ...,  # Other extensions go here
                "html_section",
                ]

Usage

Contents
-----------

.. html-section::

The section label Contents will only be shown with the HTML builder. However, the section content will still be visible, and the heading will appear in the table of contents. Consider using Sphinx's .. only:: html directive for that.

Contents
-----------

.. latex-section::

The section label Contents will only be shown with the LaTeX builder. However, the section content will still be visible, and the heading will appear in the table of contents. Consider using Sphinx's .. only:: latex directive for that.

New in version 0.3.0

Contents
-----------

.. phantom-section::

The section label Contents will be hidden with all builders, but the section will still exist in the structure of the document (i.e. a new section will be started, without a label). The section content will still be visible, and the heading will appear in the table of contents.