Archive for April 5th, 2011
pwt.jinja2js 0.6.0
I have just uploaded a version 0.6.0 of pwt.jinja2js. This adds support for default values for macros arguments. So now you can do this:
{% macro defaultparam1(name = "World") -%}
Hello {{ name }}!
{%- endmacro %}
And you can call this like so to produce the desired output:
defaultparam1({}) -> "Hello World"
defaultparam({name: 'Michael'}) -> "Hello Michael"