In Jinja2, macros and includes appear to do pretty much the same thing.
e.g.
{% macro input(name, value='', type='text') -%}
<input type="{{ type }}" value="{{ value|e }}" name="{{ name }}">
{%- endmacro %}
{{ input('password', type='password') }}
-- versus --
{% include 'input.html' %}
input.html file>
<input type="{{ type }}" value="{{ value|e }}" name="{{ name }}">
In order to clarify their uses:
- Is there a time when one will work, when the other will not?
- If both will work, when should we prefer one over the other?