TP <[email protected]> writes:
> On Fri, Apr 2, 2010 at 9:46 AM, Nikolaus Rath <[email protected]> wrote:
>> Hello,
>>
>> I am using
>>
>> {%- if display_toc %}
>> <h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents')
>> }}</a></h3>
>> {{ toctree() }}
>> {%- endif %}
>>
>> to display a table of contents in the sidebar. This works nicely in most
>> cases. However, if a document has only one section, the tree is missing
>> entirely.
>>
>
> I ran into this also (with latest development version). Seems this is
> the designed behavior. Looking at sphinx/builders/html.py I see the
> following in def get_doc_context(self, docname, body, metatags):
> # only display a TOC if there's more than one item to show
> display_toc = (self.env.toc_num_entries[docname] > 1),
>
> So, all I did was remove the surrounding
>
> {%- if display_toc %}
> {%- endif %}
>
That works for me too, thanks!
But can anyone tell me the motivation behind this design? Why would I
want a page without TOC just because there is only one section in it?
Best,
-Nikolaus
--
»Time flies like an arrow, fruit flies like a Banana.«
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
--
You received this message because you are subscribed to the Google Groups
"sphinx-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sphinx-dev?hl=en.