86 releases
0.11.0 | Oct 26, 2021 |
---|---|
0.10.0 | Jul 14, 2021 |
0.9.33 | Feb 19, 2021 |
0.9.31 | Dec 24, 2020 |
0.9.19 | Nov 28, 2020 |
#354 in Template engine
175 downloads per month
Used in bracket-fluent
265KB
6K
SLoC
Bracket
Alternative template engine using handlebars-compatible syntax designed for speed, correctness and excellent error handling.
Inspired by handlebars-rust but the API is incompatible in certain places where we think the design should be different.
Except for partials the library does not take ownership of the underlying template strings it simply references them as string slices so it is the caller's responsibility to store them; as a convenience a Loader
can be used to store and load templates from disc.
Features
The default features are batteries included but you can set default-features = false
and cherry pick.
helpers
: Include all helpers.log-helper
: Enable thelog
helper.each-helper
: Enable theeach
helper.with-helper
: Enable thewith
helper.lookup-helper
: Enable thelookup
helper.json-helper
: Enable thejson
helper.conditional-helper
: Enable theif
andunless
helpers.logical-helper
: Enable theand
,or
andnot
helpers.comparison-helper
: Enable theeq
,ne
,gt
,lt
,gte
andlte
helpers.stream
: Enable thestream
functions on the registry.fs
: Support loading templates from the filesystem.
Lifetimes
'reg
The lifetime of the registry; helpers, partials and escape functions.'source
The lifetime of a source template string.'render
The lifetime of a template render.'call
The lifetime of a helper call.
Dependencies
~3.5–4.5MB
~54K SLoC