I had trouble with this too; I found the answer here.
The TOC is shown via a call to toctree()
inside, e.g., a file called layout.html. In particular, it is shown in the sidebar via a snippet of code similar to the following, which resides in <div class="sidebar">
:
{% block sidebartoc %}
<h3>{{ _('Table Of Contents') }}</h3>
{{ toctree() }}
{% endblock %}
Since I am using a theme, layout.html is within the theme directory inside the directory _themes; otherwise layout.html might be inside the directory _templates.
In newer versions of Sphinx, what is needed to display the TOC when :hidden:
is used as in
.. toctree::
:hidden:
is to add the argument includehidden=True
to the call to toctree()
, as in
{% block sidebartoc %}
<h3>{{ _('Table Of Contents') }}</h3>
{{ toctree(includehidden=True) }}
{% endblock %}