Hierarchy Demo
This page demonstrates how you can use Dactyl's built-in hierarchy features to generate a table of contents automatically.
Source:
<ul>
{% macro page_w_children(pg) %}
<li class="dactyl-toc-entry"><a href="{{ pg.html }}">{{ pg.name }}</a></li>
{% if pg.children %}
<ul>
{% for child in pg.children %}
{{ page_w_children(child) }}
{% endfor %}
</ul>
{% endif %}
{% endmacro %}
{% for page in pages %}
{% if page.parent is undefined %}
{{ page_w_children(page) }}
{% endif %}
{% endfor %}
</ul>
Results:
- Index
- Usage
- Features
- Code Highlighting
- Includes
- Frontmatter
- Commandline Variables
- Conditionals
- Lists and Code Blocks Demo
- GitHub Markdown Compatibility
- Header Stress Test
- Virtual Pages
- Filters
- Callouts Demonstration
- Intelligent Cross-References
- Buttonize Filter
- Badges
- Multi Code-Tabs Filter
- External Links
- Extending Dactyl