Releases: emacs-love/templatel
Releases · emacs-love/templatel
0.1.6
- Default variables to
undefined
instead of raising an error - Added test operator
is
that is another syntax for passing parameters to functions that have a defined signature, they must return a Boolean value. e.g.:{% if something is defined %}
. - Support
{% include %}
statements (Thanks to Guilherme Guerra) - New tests added:
defined
,divisible
- New filters added:
take
(Thanks to Marko Kocić),abs
, capitalize,escape
(e
),float
,join
,length
,max
,min
,round
, andtitle
. Documentation is still ongoing, and help is wanted :) - Filter deprecated:
getattr
, please useattr
instead - fix: for loop must access expression via value stack [commit]
- fix: parsing floating point numbers [commit]
- fix: filter operator precedence [commit]
- fix: operators for remainder of division (
%
) and exponential**
implemented. They were present in the syntax but didn't have an implementation
0.1.5
- feat: new filters added:
first
,last
,getattr
anddefault
- feat: API for removing a template from an environment by name:
templatel-env-remove-template
- fix: fix inheritance so both
extends
andsuper()
work recursively. E.g.:post.html
extendsbase_post.html
that extendsbase.html
. - fix: render
nil
value as an empty string instead of inserting the"nil"
string into the output file
0.1.4
0.1.3
- Support for named arguments on filters. They are passed to the handler as an
assoc
list. E.g.:{{ foo(var1="val", var2=2) }}
will get((var1 . val) (var2 . 2))
as the only parameter. Named and positional arguments can be mixed, but the Emacs-Lisp handler will have to deal with the order.
0.1.2
- Support for user defined filter functions via
templatel-env-add-filter
andtemplatel-env-remove-filter
- Fix parsing expressions and statements without spaces after brackets, e.g.:
{{var}}
,{%if stuff%}
- Parse and evaluate standalone function calls. E.g.:
{{ super() }}
- Breaking change:
super()
is now a function, not a variable anymore. But still only exists while blocks are evaluated
0.1.1
0.1.0
templatel is a template language for Emacs-Lisp. It's inspired by Python's Jinja and provides most of its interesting functionalities, like a powerful expression language, if
and for
statements as well as the ability to inherit templates with statements extends
and block
.
This initial release counts with the following value filters:
- upper
- lower
- sum
- plus1
- int