{% import "macros.html" as ui %} {# The icon comes before the link: on branches it opens/closes the branch, the name navigates. Packages show a folder, modules (files) a file, other entities their kind symbol. label replaces the shown name (the root package is shown as CODE). #} {% macro link(item, label=none) %} {{- label or item.name -}} {% endmacro %} {% macro node(item, label=none) %}
  • {% if item.children %} {# Only the root package starts open (its first level is listed, folded); every other branch opens only when the user opens it. What the user opens or closes is remembered per tab. #}
    {{ ui.icon(item.role, item.symbol) }}{{ link(item, label) }}
    {% else %}
    {{ ui.icon(item.role, item.symbol) }}{{ link(item, label) }}
    {% endif %}
  • {% endmacro %}