{% macro caption( text, source_list=None, definition_list=False, pre_caption=False ) -%} {% if text is string %} {% set text = [text] %} {% endif %}
{% if definition_list %}
{% for item in text %} {% set parts = item.split(':') %}
{{ parts[0] }}
{{ ':'.join(parts[1:]) }}
{% endfor %}
{% else %} {% for paragraph in text %}

{{ paragraph }}

{% endfor %} {% if source_list %}

Sources: {{ source_list | join('; ') }}

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