Table of Contents¶
Processor name: table-of-contents
Danger
The table-of-contents tag currently requires integration with other systems, use of this tag should accompany supervision of a developer.
You can create a placeholder for a web framework (for example: Django) to insert a table of contents by using the following tag:
{table-of-contents}
Tag Parameters¶
There are no required or optional tag parameters for table of contents.
Example
Using the following tag:
{table-of-contents}
The resulting HTML would be:
{{ table_of_contents }}
Overriding HTML for Table of Contents¶
There are no Jinja2 placeholders available when overriding the HTML for table of contents.
The default HTML for table of contents is:
<remove>
{{ "{{ table_of_contents }}" }}
</remove>
Example
For example, providing the following HTML:
<div class="toc">
<strong>Table of Contents</strong>
<ul>
{% raw -%}
{% for heading in headings %}
<li>
<a href="#{{ heading.id }}">{{ heading.name }}</a>
</li>
{% endfor %}
{% endraw -%}
</ul>
</div>
with the following tag:
{table-of-contents}
would result in:
<div class="toc">
<strong>Table of Contents</strong>
<ul>
{% for heading in headings %}
<li>
<a href="#{{ heading.id }}">{{ heading.name }}</a>
</li>
{% endfor %}
</ul>
</div>