You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There should be some means of signaling that we should render a table of contents in the more-text.
With this mechanism, we would set nesting_level on the HtmlRenderer and also run an HtmlTocRenderer with the same nesting level.
Possible Solution
entry._get_markup() could also take a show_toc=N parameter, which is set to None on entry.text and to a value indicated by a Toc-Level header on the entry itself. Perhaps it should take the minimum of the entry's value and the template's value (so both the template and the entry need to want a TOC for it to display).
The TOC content itself could be wrapped in a <div class="toc"> (or maybe an id with the caveat that it only makes sense to render a single entry's more content on a single page).
Context
Would be great for the manual, among other things.
The text was updated successfully, but these errors were encountered:
In the interest of generality I'd actually like to see the TOC renderer be called explicitly, like:
{% if entry.toc %}
<div class="toc">{{entry.toc}}</div>
{% endif %}
where entry.toc is truthy if Toc-Level is set, and renders out the HtmlTocRenderer for entry.more. And then entry.more would always use Toc-Level for its nesting_level parameter.
It's also tempting to just have the template itself indicate whether it should use HtmlTocRenderer or not, and set the nesting_level, so that entry.text can get it too, but I'm fine with limiting TOCs to entry.more.
Expected Behavior
There should be some means of signaling that we should render a table of contents in the more-text.
With this mechanism, we would set
nesting_level
on the HtmlRenderer and also run anHtmlTocRenderer
with the same nesting level.Possible Solution
entry._get_markup()
could also take ashow_toc=N
parameter, which is set toNone
onentry.text
and to a value indicated by aToc-Level
header on the entry itself. Perhaps it should take the minimum of the entry's value and the template's value (so both the template and the entry need to want a TOC for it to display).The TOC content itself could be wrapped in a
<div class="toc">
(or maybe anid
with the caveat that it only makes sense to render a single entry'smore
content on a single page).Context
Would be great for the manual, among other things.
The text was updated successfully, but these errors were encountered: