{% import "macros.html" as ui %} {# The icon comes before the link: on branches it opens/closes the branch, the name navigates. Packages and folders show a folder, modules (files) a file, other entities their kind symbol. A branch is remembered by its place in the tree (`place`): the same entity can sit in several. #} {% macro link(item) %} {% if item.link %} {{- item.name -}} {%- else %}{{ item.name }}{% endif %} {% endmacro %} {% macro node(item, place) %}
  • {% if item.children %} {# Every branch starts closed and opens only when the user opens it; what the user opens or closes is remembered per tab. Folders and language branches have no page: their name only opens them. #} {% set key = place ~ "/" ~ item.path %}
    {{ ui.icon(item.role, item.symbol) }}{{ link(item) }}
    {% else %}
    {{ ui.icon(item.role, item.symbol) }}{{ link(item) }}
    {% endif %}
  • {% endmacro %} {# A fixed page of a section (pages.SECTIONS), marked when it is the one shown; CODE › Diagrams opens the tab used last. #} {% macro page_link(page) %} {% set url = "/code/diagrams/" ~ diagram_tab if page.views[0] == "architecture" else page.url %} {{ page.title }} {%- endmacro %} {# A section's heading: its icon opens and closes it, its name opens its explanation page. #} {% macro heading(name, title, url) %} {{ ui.icon(name) }}{{ title }} {%- endmacro %}