Skip to content

Releases: clarete/templatel

0.1.6

25 Apr 22:20
Compare
Choose a tag to compare
  • 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, and title. Documentation is still ongoing, and help is wanted :)
  • Filter deprecated: getattr, please use attr 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

04 Mar 14:01
Compare
Choose a tag to compare
  • feat: new filters added: first, last, getattr and default
  • feat: API for removing a template from an environment by name: templatel-env-remove-template
  • fix: fix inheritance so both extends and super() work recursively. E.g.: post.html extends base_post.html that extends base.html.
  • fix: render nil value as an empty string instead of inserting the "nil" string into the output file

0.1.4

18 Jan 17:25
Compare
Choose a tag to compare
  • Add support for automatic HTML entity escaping
  • Fix reading UTF-8 characters with more than one byte
  • Documentation overhauling

0.1.3

06 Dec 03:04
Compare
Choose a tag to compare
  • 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

26 Aug 03:10
Compare
Choose a tag to compare
  • Support for user defined filter functions via templatel-env-add-filter and templatel-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

18 Aug 01:01
Compare
Choose a tag to compare
  • Fix elif without else statements
  • Make templatel-env-{source,run-importfn} private
  • Pretty big refactoring cleaning up the symbol names
  • Documentation of the project was kicked off

0.1.0

06 Aug 23:07
Compare
Choose a tag to compare

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