wrouesnel / p2cli

pongo2 cli - like the j2cli package in python, but compiles to self-contained go executables
GNU General Public License v2.0
87 stars 20 forks source link

Jinja2 vs. Django template syntax #22

Closed breml closed 3 years ago

breml commented 3 years ago

The library used for the template processing (https://github.com/flosch/pongo2) does process Django-syntax like templates. Therefore the claim in the README, that p2cli does process Jinja2 templates is a bit misleading (even though the syntax of the two is similar, for the differences see: https://jinja.palletsprojects.com/en/2.10.x/switching/#django).

If the goal of p2cli is to support Jinja2 syntax, maybe have a look at https://github.com/noirbizarre/gonja. The documentation is unfortunately not up to date, but this library does support Jinja2 filters (e.g. {{ foo | default("bar") }}) as well as string concatenation with ~.