Skip to main content

Sphinx toctree that filters out entries by prefix.

Project description

filtered-toctree

filtered-toctree allows you to filter pages out of your documentation's navigation by prefixing ToC entries with configurable tags.

Basic usage

First, list the tags you wish to exclude with toc_filter_exclude in your conf.py file:

toc_filter_exclude = ["exclude", "hidden"]

To filter entries out of your documentation's navigation, prefix either the document's label or target with one of the tags defined in toc_filter_exclude:

.. filtered-toctree::

    :exclude:how-to-code
    Unit testing <:hidden:unit-testing>

Aside from this added functionality, filtered-toctree behaves exactly the same as the toctree directive.

Project setup

filtered-toctree is published on PyPI and can be installed with:

pip install filtered-toctree

After adding filtered-toctree to your Python project, update your Sphinx's conf.py file to include filtered-toctree as one of its extensions:

extensions = [
    "filtered_toctree"
]

Community and support

You can report any issues or bugs on the project's GitHub repository.

filtered-toctree is covered by the Ubuntu Code of Conduct.

License and copyright

filtered-toctree is released under the GPL-3.0 license.

© 2025 Canonical Ltd.

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_filtered_toctree-0.0.7.tar.gz (72.1 kB view details)

Uploaded Source

Built Distribution

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

sphinx_filtered_toctree-0.0.7-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_filtered_toctree-0.0.7.tar.gz.

File metadata

  • Download URL: sphinx_filtered_toctree-0.0.7.tar.gz
  • Upload date:
  • Size: 72.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sphinx_filtered_toctree-0.0.7.tar.gz
Algorithm Hash digest
SHA256 0c7bb0928035650a1c74b588be5c517db8492bb380109682a2b9de789ad39957
MD5 89cd54324cf321dd3a85fe2aa53f8d26
BLAKE2b-256 c52583e6498bd463f7f201e0e5923bf24a877752a66a96b7b2bb7dde43777d02

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_filtered_toctree-0.0.7.tar.gz:

Publisher: release-publish.yaml on canonical/sphinx-filtered-toctree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_filtered_toctree-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_filtered_toctree-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 17910977997b70a8b371d72f7ec0b57884f8495daede21ae85799c8bb94677cc
MD5 ee3fb7ad25f8cad4adda6a4ce2e8811f
BLAKE2b-256 3158b82818eabaf50814fd45ca5204a503f27bacc7d3f86dab484303b440e969

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_filtered_toctree-0.0.7-py3-none-any.whl:

Publisher: release-publish.yaml on canonical/sphinx-filtered-toctree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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