{# Shared macros for ALABAMA wISP documents #} {% macro header(d) %}
{{ d.doc_label }}
{{ d.doc_number }}
{% endmacro %} {% macro title_block(d) %}

{{ d.title }}

{% if d.subtitle %}
{{ d.subtitle }}
{% endif %}
{% endmacro %} {% macro meta_grid(cells) %}
{% for c in cells %}{% if c.value %}
{{ c.label }}
{{ c.value }}
{% endif %}{% endfor %}
{% endmacro %} {% macro party(heading, p) %}
{{ heading }}
{% if p.name %}
{{ p.name }}
{% endif %} {% if p.contact %}
{{ p.contact }}
{% endif %} {% if p.address %}
{{ p.address }}
{% endif %} {% if p.phone %}
{{ p.phone }}
{% endif %} {% if p.email %}
{{ p.email }}
{% endif %} {% if p.coordinates %}
{{ p.coordinates }}
{% endif %}
{% endmacro %} {# Generic section renderer: kv | table | list | olist | text #} {% macro section(s) %}
{% if s.heading %}

{{ s.heading }}

{% endif %} {% if s.type == 'kv' %} {% for r in s.rows %}{% endfor %}
{{ r.label }}{{ r.value }}
{% elif s.type == 'table' %} {% if s.columns %}{% for col in s.columns %}{% endfor %}{% endif %} {% for row in s.rows %}{% for cell in row %}{% endfor %}{% endfor %}
{{ col }}
{{ cell.value if cell.value is defined else cell }}
{% elif s.type == 'list' %} {% elif s.type == 'olist' %}
    {% for it in s['items'] %}
  1. {{ it }}
  2. {% endfor %}
{% elif s.type == 'text' %} {% for para in (s.body if s.body is iterable and s.body is not string else [s.body]) %}

{{ para }}

{% endfor %} {% endif %}
{% endmacro %} {% macro note(n) %} {% if n %}
{{ n.heading or 'Note' }}
{{ n.body }}
{% endif %} {% endmacro %} {% macro signatures(sigs) %}
{% for s in sigs %}
{{ s.role }}
{% if s.who %}
{{ s.who }}
{% endif %}
{% endfor %}
{% endmacro %}