{# Navigation macros. `go` is the one way a page links to another. Every such link declares its own target, trigger and replacement region as attributes -- which is what makes each fragment self-sufficient: onward navigation needs nothing the page does not already state. The swap replaces
, and takes the header and the tree from the same response (hx-select-oob), so the reader's place in both moves with them. Without htmx each is an ordinary link to a complete page. The hx-get below is the attribute the specification's "declarative interactivity" requirement names as its implementation. #} {% macro go(route, base="") -%} href="{{ base }}{{ route }}" hx-get="{{ base }}{{ route }}" hx-target="#main" hx-select="#main" hx-select-oob="#topbar,#sidebar" hx-swap="innerHTML{% if '#' not in route %} show:window:top{% endif %}" hx-push-url="true" hx-trigger="click" {%- endmacro %} {% macro kind_dot(kind) -%} {%- endmacro %} {# One edge group. The heading is the first thing in the section on purpose: both directions of an edge are presented by exactly this shape, so nothing in the markup says which direction a person typed. #} {% macro edge_list(title, members, base, note=None, absent=None, tone=None) %} {% if members or absent %}

{{ title }}

{% if members %}{{ members | length }}{% endif %} {% if note %}

{{ note }}

{% endif %} {% if members %} {% else %}

{{ absent }}

{% endif %}
{% endif %} {% endmacro %}