{% macro acc(kind) -%}{{ acc_words[kind] }}{%- endmacro %} {% macro insight_card(card, prefix='', heading='h4', chart=none) -%}
<{{ heading }} class="subh" id="{{ prefix }}{{ card.id }}-h">{{ card.title }}{{ card.column }}{% for kind in card.kinds %}{{ acc(kind) }}{% endfor %}
{% if card.summary %}

{{ card.summary }}

{% endif %} {% for line in card.lines %}

{% for part in line.parts %}{% if part.code %}{{ part.text }}{% else %}{{ part.text }}{% endif %}{% endfor %}{% if line.kind != 'exact' %} {{ acc(line.kind) }}{% endif %}

{% endfor %} {% if card.facts %}
{% for fact in card.facts %}
{{ fact.label }}
{{ fact.value }}{% if fact.kind != 'exact' %} {{ acc(fact.kind) }}{% endif %}{% if fact.note %}{{ fact.note }}{% endif %}
{% endfor %}
{% endif %} {% if card.bars %}
{% for bars in card.bars %}

{{ bars.caption }} {{ acc(bars.kind) }}

{% for item in bars.items %}
{{ item.label }}{{ item.count | count }}{{ '%.1f' | format(item.share * 100) }}%
{% endfor %}{% if bars.note %}

{{ bars.note }}

{% endif %}
{% endfor %}
{% endif %} {% for table in card.tables %}

{{ table.caption }} {{ acc(table.kind) }}

{% for header in table.headers %}{% endfor %}{% for row in table.rows %}{% for cell in row %}{% if loop.first %}{% else %}{% endif %}{% endfor %}{% endfor %}
{{ header }}
{% if loop.index0 in table.code %}{{ cell }}{% else %}{{ cell }}{% endif %}{% if loop.index0 in table.code %}{{ cell }}{% else %}{{ cell }}{% endif %}
{% if table.note %}

{{ table.note }}

{% endif %}{% endfor %} {% for note in card.notes %}

{{ note }}

{% endfor %}{% if chart %}

Open the chart page

{% endif %}
{%- endmacro %}