{% for img in ref.gallery %}{{ image(img, ref.gallery[img]) }}{% endfor %}
{% endmacro %}
{% macro table(t, headers=[]) %}
{% for h in headers %}{% if h %}
{{ h }}
{% endif %}{% endfor %}
{% for key in t %}
{{ key }}
{{ _list_to_cols(t[key], headers) }}
{% endfor %}
{% endmacro %}
{% macro _list_to_cols(l, headers) %}
{% if l is mapping %}
{% for key in l if key in headers%}
{{ _list_to_cols(l[key], headers) }}
{% endfor %}
{% elif l %}