Sphinx table-of-contents with super powers!
Project description
Sphinx Extension: TagTocTree
This is an extension to the documentation engine Sphinx. It allows you to include pages in a table-of-contents by using tags assigned to a page.
How it works
This extension adds a new directive tagtoctree
, which creates a tree-like
table-of-contents, filtering pages by a tag filter.
Directive | Configuration | Produces |
---|---|---|
toctree (*) |
||
tagtoctree |
(*) Sphinx native toctree
Usage
The documentation assumes you have a Sphinx project running.
-
Install using PIP:
pip install sphinx-tagtoctree
-
In your Sphinx configuration file (
conf.py
), add a entry fortagtoctree
:extensions = [ 'sphinx_tagtoctree' ]
-
(Optional) Add configuration value for
tagtoctree_tag
. If none is provided, the defaulttagtoctree
will be used.tagtoctree_tag = 'tagtoctree'
-
For each page, add a header on the top with the values of your tags. See examples page1 and page2 in this repo.
-
Finally, add a
tagtoctree
directive where you want your table-of-contents to be displayed. Example:.. tagtoctree:: :maxdepth: 1 :glob: :caption: Pages with tag "Product" :tag: Product **
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
Built Distribution
Hashes for sphinx_tagtoctree-0.9.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a6f248741c3d25fbd082c1a6de1a8d9595aebb8a798d5cd46139410cc470e4e |
|
MD5 | 62d64c67db7bd9892b9738f92514e62f |
|
BLAKE2b-256 | 8abbad4c2fab21ec4c28f5d384f87a845dce173b12a5f21c01000004d80f1e60 |