{# Also called from Python, for ingredients and pictures within the recipe text. #}
{% macro ingredient(item, tag) -%}
{% if item.amount is none -%}
<{{ tag }} data-ingredient>{{ item.name or item.raw }}{{ tag }}>
{%- else -%}
<{{ tag }} data-ingredient data-amount="{{ item.amount }}" data-unit="{{ item.unit }}" data-name="{{ item.name }}"
{%- if item.ml is not none %} data-ml="{{ item.ml|round(2) }}"{% endif %}>{{ item|quantity }}{{ tag }}>
{%- endif %}
{%- endmacro %}
{% macro picture(recipe, image, alt, root="../", thumbnail=False, lazy=True, class="") -%}
{% set files = picture_files(recipe, image, root, thumbnail) -%}
{%- endmacro %}
{% macro figure(recipe, image, alt) -%}
{{ picture(recipe, image, alt) }}
{%- endmacro %}