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 (

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 (/usr/local/lib/python2.6/site-packages/Sphinx-0.6.5-py2.6.egg/sphinx/builders/

Idea/wish: toc directive.

Published:Fri Jun 25 2010