From your examples, it looks like you are trying to import macros.jinja and use it as a macro called html . This does not work like that.
Macros are defined in a jinja file with names there.
macros.jinja:
{% macro dostuff(x,y,z) %} <a href="{{ x }}" title="{{y}}">{{z}}</a> {% endmacro %}
and then you can import the whole files with the import tag:
{% import "macros.jinja" as macros %}
So, in your current namespace you will have macros that points to the macros.jinja file. To use the dostuff macro, you need to call macros.dostuff(...) .
You need to define a macro called html inside macros.jinja, import macros.jinja as macros , and then invoke it with macros.html(...) .
Does this make sense?
source share