{# A figure of a report: an SVG with its spec inline, `data-figure` and `data-figure-spec` by its key, which a page reads, else the image of `src`. A caption is the body of a call of the macro. #} {% macro figure(key, svg=None, spec_text=None, src=None, alt="") -%} {% if svg and spec_text -%} {{ svg | safe }} {%- else -%} {{ alt }} {%- endif %} {% if caller is defined %}{{ caller() }}{% endif %} {%- endmacro %}