- Performance improvements thanks to @wdv4758h
- Correctly register
date
filter and make it work on a RFC3339 string as well thanks to @philwhineray
- Added
Tera::value_one_off
to parse and render a single template using a Json value as context
not
is now a Tera keyword
- Added
#![deny(missing_docs)]
to the crate - Added
Tera::one_off
to parse and render a single template - Added
not
operator in conditions to mean falsiness (equivalent to!
in Rust) - Remove specific error message when using
||
or&&
- Improved performances for parsing and rendering (~5-20%)
- Added
precision
arg toround
filter - Added
date
filter to format a timestamp to a date(time) string
A few breaking changes in this one
- Tera no longer panics when parsing templates, it returns an error instead
- Tester fn signature changes from
fn(&str, Option<Value>, Vec<Value>) -> Result<bool>
tofn(Option<Value>, Vec<Value>) -> Result<bool>
- Rename
TeraResult
export toResult
- Stabilized
Tera::add_template
andTera::add_templates
- Added
compile_templates!
macro to try to compile all templates and, in case of errors, print them and exit the process - Much improved error messages
- Add a magical variable
__tera_context
that will pretty print the current context - More documentation inside the crate itself
- Actually register the
filesizeformat
,slugify
,addslashes
, good thing no one noticed - Add
divisibleby
anditerable
test - Made
try_get_value!
macro work outside of Tera
- Remove println! left behind
- Fix macros not being found in child templates
- Export
Value
andto_value
(currently from serde-json)
- Add macros
- Add
filesizeformat
filter - Add autoescape
- Add multiple level inheritance
- Add nested blocks
- Add
{{ super() }}
Thanks to @SergioBenitez and @yonran for the help!
- Fix regression when using variables in forloops + add test for it
- Change signature of tests functions (BREAKING CHANGE)
- Add more tests:
undefined
,odd
,even
,number
andstring
- Add
include
directive to include another file - Indexed array/tuple access using the
.x
wherex
is an integer
Thanks to @SergioBenitez and @andrelmartins for the contributions!
- Added filters, see README for current list
- Added tests, only
defined
for now
Thanks to @SergioBenitez, @orhanbalci, @foophoof and @Peternator7 for the contribution!
- Completely new parser
- Expose TeraError