diff --git a/doc/templating.rst b/doc/templating.rst index 05a1346c0..b9dfc683b 100644 --- a/doc/templating.rst +++ b/doc/templating.rst @@ -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. diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index f5218673f..7fa42057f 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -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']