from pystache import handlebars
from operator import add
renderer = handlebars.Renderer()
renderer.register_helper('+', add)
print renderer.render("the sum of {{a}} and {{b}} is {{+ a b}}",
{'a': 1, 'b': 1})
If everything goes well, output should be:
the sum of 1 and 1 is 2
also change version to 0.5.4-handlebars to differenciate from upstream
Use like this:
If everything goes well, output should be:
also change version to 0.5.4-handlebars to differenciate from upstream