{# Pieces shared by every wiki template. Import with: {% import "macros.html" as ui %} #}
{# Attributes of a link that opens a page inside the content panel (htmx) and updates the URL. #}
{% macro nav_url(url) -%}
href="{{ url }}" hx-get="{{ url }}" hx-target="#content" hx-push-url="true"
{%- endmacro %}
{# The same, for the wiki page of an entity. #}
{% macro nav(path) -%}
{{ nav_url("/wiki/" ~ path) }}
{%- endmacro %}
{# Icon of an entity role: folder/file emoji for packages and modules, colored symbol for the rest. #}
{% macro icon(role, symbol="") -%}
{{ symbol }}
{%- endmacro %}
{# Header of a graph view page. #}
{% macro view_header(view, title, text) -%}
{{ icon(view) }}{{ title }}
Loading…