Bug #1047: templating toctree()'s includehidden argument

Document the includehidden option and give it sane defaults.
See bug #1047 for implementation alternatives.
This commit is contained in:
Roland Meister 2012-12-10 21:54:11 +01:00
parent 6748b60d39
commit 50fadb9e94
2 changed files with 5 additions and 0 deletions

View File

@ -391,3 +391,6 @@ are in HTML form), these variables are also available:
* ``titles_only`` (false by default): if true, put only toplevel document
titles in the tree
* ``includehidden`` (false by default): if true, the TOC tree will also
contain hidden entries.

View File

@ -653,6 +653,8 @@ class StandaloneHTMLBuilder(Builder):
self.indexer.feed(pagename, title, doctree)
def _get_local_toctree(self, docname, collapse=True, **kwds):
if 'includehidden' not in kwds:
kwds['includehidden'] = False
return self.render_partial(self.env.get_toctree_for(
docname, self, collapse, **kwds))['fragment']