banner

Local table of contentsΒΆ

It’s not possible to use the ‘toctree’ directive to insert a local table of contents on a page. An example of a local table of contents can be seen in the sidebar of your Sphinx site. The table of contents in the sidebar is generated on template level. See the ‘toc’ template variable (http://sphinx.pocoo.org/templating.html?highlight=template#toc)

The ‘toc’ variable is used in the basic theme layout.html template file (/usr/local/lib/python2.6/site-packages/Sphinx-0.6.5-py2.6.egg/sphinx/themes/basic/layout.html).

The ‘toc’ variable is expanded by the get_toc_context function in html.py (/usr/local/lib/python2.6/site-packages/Sphinx-0.6.5-py2.6.egg/sphinx/builders/html.py).

Idea/wish: toc directive.


Published:Fri Jun 25 2010