Hello,
I'm trying to write a Jinja template like this:
(if "{% if " (p "Prefix: " pre) (p "Var: " var) " is defined %}" n
(s var) " = {{ " (s pre) (s var) " }}" n
"{% endif %}")
This also don't work:
(if (p "Prefix: " pre t) "{% if " (s pre) (p var) " is defined %}" n
(s var) " = {{ " (s pre) (s var) " }}" n
"{% endif %}")
I want to generate something like this:
{% if prefix.var is defined %}
var = {{ prefix.var }}
{% endif %}
# or like this:
{% if prefix_var is defined %}
var = {{ prefix_var }}
{% endif %}
but I end up with:
{% if ra.xiferpvVar: is defined %}
Var: is = {{ ra.xiferpvVar: is }}
{% endif %}
It seems like, when two (p) or (s) are consecutive without a string to separate them, the cursor always come back to the begin of the first field.
Thanks @minad for Tempel, it's simple and yet powerfull !
Hello,
I'm trying to write a Jinja template like this:
This also don't work:
I want to generate something like this:
but I end up with:
It seems like, when two (p) or (s) are consecutive without a string to separate them, the cursor always come back to the begin of the first field.
Thanks @minad for Tempel, it's simple and yet powerfull !