Sphinx Tree View¶
A lightweight Sphinx extension that provides a customizable, filesystem-like tree view for your documentation.
Installation¶
Install the extension via PyPI:
pip install sphinx-treeview
Then, add it to the extensions list in your conf.py:
extensions = ["sphinx_treeview"]
If you are using MyST Parser to write Markdown documentation, it’s recommended to enable the colon_fence syntax extension:
extensions = ["myst_parser", "sphinx_treeview"]
myst_enable_extensions = ["colon_fence"]
Examples¶
A basic tree structure with one folder and two files:
folder
file.jpeg
file.png
A collapsible tree with nested folders, one collapsed by default:
folder
user
notes.txt
not-a-secret
secret.txt