v0.16.0
This new release increases compatibility with jinja language, add support for more rust expressions in the templates. Take a look at the book for the migration guide.
(❗ = breaking change)
-
❗Add support for
let blocksby @GuillaumeGomez in https://github.com/askama-rs/askama/pull/697 -
Implement compound assignments (e.g.
{% mut a += 1 %}) by @Kijewski in https://github.com/askama-rs/askama/pull/685 -
Add support for tuple, array and slice in type generics by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/721
-
Add support for macro args type annotations by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/722
-
Add support for
caller()in variable declaration by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/724 -
Add glob support for
dirsin config file by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/731
- Fix jinja macro arguments handling by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/709
- parser: reject non-ASCII characters in byte literals by @Kijewski in https://github.com/askama-rs/askama/pull/694
- parser: reject syntaxes that could cause catastrophic backtracking by @Kijewski in https://github.com/askama-rs/askama/pull/695
- derive: make sure the
size_hintis collected by @Kijewski in https://github.com/askama-rs/askama/pull/700 - Fix build determinism and macro path management by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/710
- Correctly handle non-ident item in block error by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/717
- Fix compiler error with recursive types on recursive templates by using
dyninstead of plain generic bounds by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/726 - Fix print = "code" by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/729
- Switch to
std::path::absoluteto avoid symlinking template paths by @kaepr in https://github.com/askama-rs/askama/pull/720 - Fix askama template when called from within a macro in a different crate by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/728
- ❗Turn duplicated block warning into an error by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/711
- Greatly speed up nested array parsing by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/702
- Add custom escaper example by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/725
- Improve documentation for
configby @GuillaumeGomez in https://github.com/askama-rs/askama/pull/732 - Document when
Templatetrait methods can returnErrby @GuillaumeGomez in https://github.com/askama-rs/askama/pull/730
- Limit recursions for
Tygenerics by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/723 - Add regression test for temporary refs for #661 by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/688
- Add
complex-expressionbenchmark by @Kijewski in https://github.com/askama-rs/askama/pull/691 - Simplify
Cargo.tomlfiles by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/696 - Clean compound implementation by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/699
- Update
rand+rand_xoshirodev-dependencies by @Kijewski in https://github.com/askama-rs/askama/pull/701 - Upgrade winnow to 1.0 by @jplatte in https://github.com/askama-rs/askama/pull/715
- Remove unnecessary .clone() by @jplatte in https://github.com/askama-rs/askama/pull/716
- Remove unused lifetime parameter on SyntaxAndCache by @jplatte in https://github.com/askama-rs/askama/pull/714
- Correctly handle non-ident item in block error by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/717
- Update
trybuildversion to1.0.116to enforce diagnostics width by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/718
- @jplatte made their first contribution in https://github.com/askama-rs/askama/pull/715
- @kaepr made their first contribution in https://github.com/askama-rs/askama/pull/720
Full Changelog: https://github.com/askama-rs/askama/compare/v0.15.4...v0.16.0
v0.15.6
- Correctly handle non-ident item in block error by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/717
- Remove unnecessary
.clone()by @jplatte in https://github.com/askama-rs/askama/pull/716 - Remove unused lifetime parameter on
SyntaxAndCacheby @jplatte in https://github.com/askama-rs/askama/pull/714 - Upgrade
winnowto 1.0 by @jplatte in https://github.com/askama-rs/askama/pull/715
Full Changelog: https://github.com/askama-rs/askama/compare/v0.15.5...v0.15.6
v0.15.5
- parser: reject non-ASCII characters in byte literals by @Kijewski in https://github.com/askama-rs/askama/pull/694
- parser: reject syntaxes that could cause catastrophic backtracking by @Kijewski in https://github.com/askama-rs/askama/pull/695
- Fix jinja macro arguments handling by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/709
- Fix build determinism and macro path management by @GuillaumeGomez and @cgundy in https://github.com/askama-rs/askama/pull/710
Full Changelog: https://github.com/askama-rs/askama/compare/v0.15.4...v0.15.5
v0.15.4
- Improve function call handling by @Kijewski in https://github.com/askama-rs/askama/pull/684
- Correctly handle temporary references by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/686
Full Changelog: https://github.com/askama-rs/askama/compare/v0.15.3...v0.15.4
v0.15.3
- Update book links (askama.rs) by @Kijewski in https://github.com/askama-rs/askama/pull/678
- Fix invalid variable parsing by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/680
Full Changelog: https://github.com/askama-rs/askama/compare/v0.15.2...v0.15.3
v0.15.2
- Correctly handle local variables in
extendsblocks by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/670 - Better spans for
#[filter_fn]by @Kijewski in https://github.com/askama-rs/askama/pull/655 - Remove mentions of
salvoby @Kijewski in https://github.com/askama-rs/askama/pull/659 - Add missing information in the
Upgrading to new versionschapter in the askama book by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/665 - Fix invalid block call warnings coming from
extendsby @GuillaumeGomez in https://github.com/askama-rs/askama/pull/666 - Update duplicated blocks warning message and add warning about not compiling starting next version by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/669
- derive: allow
wherebounds in#[filter_fn]by @Kijewski in https://github.com/askama-rs/askama/pull/672 - [Book] Improve
filterschapter by @Tirka in https://github.com/askama-rs/askama/pull/673 - [Book] Use more current markdown syntax for fragment links by @Kijewski in https://github.com/askama-rs/askama/pull/658
- [Book] Improve
filterschapter examples (by making us ofdefined_orfilter) by @Tirka in https://github.com/askama-rs/askama/pull/675
- @Tirka made their first contribution in https://github.com/askama-rs/askama/pull/673
Full Changelog: https://github.com/askama-rs/askama/compare/v0.15.1...v0.15.2
v0.15.1
- Fix broken intra-doc links by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/645
- Fix missing mutability information in generated filters by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/646
- Fix clippy false positives by using
call_sitefor code generated by the derive proc-macro by @sehnryr in https://github.com/askama-rs/askama/pull/647 - Add support for lifetimes in filters by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/649
- @sehnryr made their first contribution in https://github.com/askama-rs/askama/pull/647
Full Changelog: https://github.com/askama-rs/askama/compare/v0.15.0...v0.15.1
v0.15.0
The main breaking change is about custom filters, they now require the filter_fn attribute. More information about it in the askama book.
(❗ = breaking change)
- ❗ add caller pattern from jinja❗ by @pollend in https://github.com/askama-rs/askama/pull/422
- ❗Add new
rejectfilter❗ by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/430 - ❗Treat caller() as variable with support for aliasing❗ by @seijikun in https://github.com/askama-rs/askama/pull/510
- ❗Add filters
|default,|assigned_orand|defined_or❗ by @Kijewski in https://github.com/askama-rs/askama/pull/425 - ❗Update minimum supported rust version to 1.88❗ by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/523
- ❗Add
askama::filter_fnproc-macro for custom filters with named/optional arg support❗ by @seijikun in https://github.com/askama-rs/askama/pull/545 - Implement
enumvariants by @Kijewski in https://github.com/askama-rs/askama/pull/255 - Allow filters with explicit path by @Kijewski in https://github.com/askama-rs/askama/pull/435
- Add support for mutable variables by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/462
- Add support for macro default value generics by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/522
- Add support for expression-call syntax for macros by @seijikun in https://github.com/askama-rs/askama/pull/518
- Implement #531: Allow named arguments in call expr macro invocations by @seijikun in https://github.com/askama-rs/askama/pull/533
- Add support for array repeat syntax:
[<element_expr>; <cnt_expr>]by @seijikun in https://github.com/askama-rs/askama/pull/626 - Add support for struct expressions by @VojtaStanek in https://github.com/askama-rs/askama/pull/602
- format non base 10 numbers at compile time by @tdelabro in https://github.com/askama-rs/askama/pull/620
- Add new tag to declare variable without value by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/613
Improve error location to give better errors:
- Greatly improve error messages on nightly by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/525
- Generate a
TokenStreamrather than aStringby @GuillaumeGomez in https://github.com/askama-rs/askama/pull/558 - parser: use
LocatingSlice<&str>instead of&strby @Kijewski in https://github.com/askama-rs/askama/pull/560 - Use
Parser::[with_]span()to get byte range and use byte range forproc_macro::Spanby @Kijewski in https://github.com/askama-rs/askama/pull/571
- ❗
filesizeformatwith proper accuracy❗ by @seijikun in https://github.com/askama-rs/askama/pull/568 - Filters
linebreaks,paragraphbreaksandlinebreaksbronly needcoreby @Kijewski in https://github.com/askama-rs/askama/pull/486 - Emit an error if an extends block doesn't come first in a template by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/584
- Fix tiny wording error in "Calling functions" docs by @m4tx in https://github.com/askama-rs/askama/pull/423
- book: complete note about filter change by @martinetd in https://github.com/askama-rs/askama/pull/453
- Update
refdocumentation by @sinder38 in https://github.com/askama-rs/askama/pull/456 - Update
performance.mdby @zamazan4ik in https://github.com/askama-rs/askama/pull/188 - book: document all crates on readthedocs by @Kijewski in https://github.com/askama-rs/askama/pull/473
- Fixed typos in template syntax book docs in https://github.com/askama-rs/askama/pull/494
- book: update
mdbookversion and highlightjinjablocks by @Kijewski in https://github.com/askama-rs/askama/pull/544 - Improve documentation by @seijikun in https://github.com/askama-rs/askama/pull/554
- Minor documentation fixes by @seijikun in https://github.com/askama-rs/askama/pull/555
- Fix some code examples annotations by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/577
- Add missing documentation about for loop features by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/576
- book: add question mark operator by @VojtaStanek in https://github.com/askama-rs/askama/pull/601
- book: add syntax summary by @VojtaStanek in https://github.com/askama-rs/askama/pull/603
- book: fix rust-docs on readthedocs by @Kijewski in https://github.com/askama-rs/askama/pull/528
- Add tests for jinja examples in our book by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/574
- Make code generator re-usable for other projects by @Kijewski in https://github.com/askama-rs/askama/pull/434
- parser: simplify
{# comment #}parsing by @Kijewski in https://github.com/askama-rs/askama/pull/488 - Rename
Expr::AttrintoExpr::AssociatedItemby @GuillaumeGomez in https://github.com/askama-rs/askama/pull/499 - parser: introduce more types for
Exprvariants by @Kijewski in https://github.com/askama-rs/askama/pull/498 - parser: refactor
|filterand{% filter %}parsing by @Kijewski in https://github.com/askama-rs/askama/pull/500 - Use
if-let-chainsby @Kijewski in https://github.com/askama-rs/askama/pull/527 - derive: more
if-letby @Kijewski in https://github.com/askama-rs/askama/pull/532 - derive: dedupe visit custom filters code by @Kijewski in https://github.com/askama-rs/askama/pull/470
- Add missing
#[inline]annotations by @Kijewski in https://github.com/askama-rs/askama/pull/421 - parser: un-inline error message generation by @Kijewski in https://github.com/askama-rs/askama/pull/501
- Refactor
indentFilter Implementation by @strickczq in https://github.com/askama-rs/askama/pull/466 - Make
wordcountfilter work with core only by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/480 - derive: un-inline
Expr::Callhandling for{{ expressions }}and remove parentheses by @Kijewski in https://github.com/askama-rs/askama/pull/540 - parser/derive: replaces usages of
Expr/NodewithBox<Expr>/Box<Node>by @Kijewski in https://github.com/askama-rs/askama/pull/542 - parser: remove one indirection in
punction()finding by @Kijewski in https://github.com/askama-rs/askama/pull/543 - filter_fn: Aggressive inlining for builder invocation methods by @seijikun in https://github.com/askama-rs/askama/pull/616
loop.firstis known by being atindex == 0by @Kijewski in https://github.com/askama-rs/askama/pull/436
- generator: remove invisible group from output by @Kijewski in https://github.com/askama-rs/askama/pull/419
- Relax Sized constraint on
impl FastWritable for Cowby @C0D3-M4513R in https://github.com/askama-rs/askama/pull/432 - Ignore fuzzing corpus from source line count by @Kijewski in https://github.com/askama-rs/askama/pull/433
- Use
unicode-identto determine what is an identifier by @Kijewski in https://github.com/askama-rs/askama/pull/443 - derive: prefix more generated variables with
__askamaby @Kijewski in https://github.com/askama-rs/askama/pull/444 - derive: don't suppress fatal errors in integer parsing by @Kijewski in https://github.com/askama-rs/askama/pull/448
- Print invalid generated code during panic by @Kijewski in https://github.com/askama-rs/askama/pull/446
- Prevent
crateto be used as identifier by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/450 - Comparison operators cannot be chained by @Kijewski in https://github.com/askama-rs/askama/pull/457
- Correctly escape and reject macro names by @Kijewski in https://github.com/askama-rs/askama/pull/460
- parser: macro calls need proper tokens by @Kijewski in https://github.com/askama-rs/askama/pull/468
- Resolve with macro with call after caller by @pollend in https://github.com/askama-rs/askama/pull/469
- parser: recognize/reject prefixed ids and lits in macro calls by @Kijewski in https://github.com/askama-rs/askama/pull/476
- parser: reject illegal string literals by @Kijewski in https://github.com/askama-rs/askama/pull/479
- Rename
LoopItem::indextoLoopItem::index0by @Kijewski in https://github.com/askama-rs/askama/pull/481 - parser: reject isolated CRs in string literals by @Kijewski in https://github.com/askama-rs/askama/pull/483
- parser: better error message for bare CRs by @Kijewski in https://github.com/askama-rs/askama/pull/485
- parser:
U+10FFFFis the highest Unicode codepoint by @Kijewski in https://github.com/askama-rs/askama/pull/484 - parser: recognize comments in macro calls by @Kijewski in https://github.com/askama-rs/askama/pull/487
- parser: implement
{% raw %}andLit::parse()withoutskip_tillby @Kijewski in https://github.com/askama-rs/askama/pull/489 - parser: fix
{% raw %}for delimiters starting with-by @Kijewski in https://github.com/askama-rs/askama/pull/491 - parser: string literal must not be immediately followed by
suffix#by @Kijewski in https://github.com/askama-rs/askama/pull/496 - parser: reject illegal raw identifiers in attribute access & ensure valid paths in generics by @Kijewski in https://github.com/askama-rs/askama/pull/497
- parser: understand nested block comments in macro calls by @Kijewski in https://github.com/askama-rs/askama/pull/504
- Fix panic when using include in call block by @seijikun in https://github.com/askama-rs/askama/pull/516
- parser: fix
check_expr()recursion by @Kijewski in https://github.com/askama-rs/askama/pull/519 - parser: reject isolated CR in macro inputs, too by @Kijewski in https://github.com/askama-rs/askama/pull/524
- parser: reject bare CR in doc comments by @Kijewski in https://github.com/askama-rs/askama/pull/526
- Fix fuzzing macro argument parsing bug by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/530
- derive: make
EvaluatedResultknow its unknown result by @Kijewski in https://github.com/askama-rs/askama/pull/538 - parser: un-inline more error messages by @Kijewski in https://github.com/askama-rs/askama/pull/539
- parser: fail on unterminated byte literal by @Kijewski in https://github.com/askama-rs/askama/pull/547
- derive: track included files with relative path by @Kijewski in https://github.com/askama-rs/askama/pull/546
- parser:
r#selfis not a valid raw identifier in macro calls by @Kijewski in https://github.com/askama-rs/askama/pull/553 - parser/derive: use only one hasher throughout the proc_macro by @Kijewski in https://github.com/askama-rs/askama/pull/557
- Fix wrong span context for askama variables by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/565
- Fix invalid handling of paths starting with
::by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/569 - README: fix a link, include readmes in
lib.rsby @Kijewski in https://github.com/askama-rs/askama/pull/573 - Fix wrong macro argument parsing by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/570
- parser:
r#_is not a valid identifier by @Kijewski in https://github.com/askama-rs/askama/pull/579 - parser: reject unclosed prefixed string by @Kijewski in https://github.com/askama-rs/askama/pull/582
- Emit warnings if duplicated
blockcalls are done by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/580 - Fix block duplication warning by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/586
- Fix wrong parsing of number if digit does not match base by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/600
- Fix formatting of
safefilter intemplate_syntax.mdby @FalkWoldmann in https://github.com/askama-rs/askama/pull/587 - Limit maximum number of references in generics to prevent
synstack overflow by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/611 - Fix nested includes not handled properly by @fbilhaut in https://github.com/askama-rs/askama/pull/619
- filter_fn: Further improve invalid invocation compile error messages by @seijikun in https://github.com/askama-rs/askama/pull/614
- Fix method call on enum variant templates by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/635
- @C0D3-M4513R made their first contribution in https://github.com/askama-rs/askama/pull/432
- @martinetd made their first contribution in https://github.com/askama-rs/askama/pull/453
- @pollend made their first contribution in https://github.com/askama-rs/askama/pull/422
- @sinder38 made their first contribution in https://github.com/askama-rs/askama/pull/456
- @zamazan4ik made their first contribution in https://github.com/askama-rs/askama/pull/188
- @seijikun made their first contribution in https://github.com/askama-rs/askama/pull/516
- @VojtaStanek made their first contribution in https://github.com/askama-rs/askama/pull/601
- @FalkWoldmann made their first contribution in https://github.com/askama-rs/askama/pull/587
- @fbilhaut made their first contribution in https://github.com/askama-rs/askama/pull/619
- @tdelabro made their first contribution in https://github.com/askama-rs/askama/pull/620
- @bwcii made their first contribution in https://github.com/askama-rs/askama/pull/630
Full Changelog: https://github.com/askama-rs/askama/compare/v0.14.0...v0.15.0
v0.14.0
- Implement
Valueson tuple by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/391 - Pass variables to sub-templates more reliably even if indirectly by @Kijewski in https://github.com/askama-rs/askama/pull/397
- Implement
firstandblankarguments for|indentby @Kijewski in https://github.com/askama-rs/askama/pull/401 - Add named arguments for builtin filters by @Kijewski in https://github.com/askama-rs/askama/pull/403
- Add
uniquefilter by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/405
askama_deriveaccidentally exposed as a feature by @Kijewski in https://github.com/askama-rs/askama/pull/384- Track config files by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/385
- If using local variable as value when creating a new variable, do not put it behind a reference by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/392
- generator: make
CARGO_MANIFEST_DIRpart ofConfigKeyby @strickczq in https://github.com/askama-rs/askama/pull/395 - Do not put question mark initialization expressions behind a reference by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/400
- Update to more current rust version on readthedocs by @Kijewski in https://github.com/askama-rs/askama/pull/410
- Fix
uniquefilter implementation by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/417 - Add
|titlecaseas alias for|titleby @Kijewski in https://github.com/askama-rs/askama/pull/416
- book: add page about
FastWritableby @Kijewski in https://github.com/askama-rs/askama/pull/407 - Add throughput to derive benchmark by @Kijewski in https://github.com/askama-rs/askama/pull/413
- Move
FastWritableintoaskamaroot by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/411
- @strickczq made their first contribution in https://github.com/askama-rs/askama/pull/395
Full Changelog: https://github.com/askama-rs/askama/compare/v0.13.0...v0.14.0
v0.13.1
askama_deriveaccidentally exposed as a feature by @Kijewski in https://github.com/askama-rs/askama/pull/384- Track config files by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/385
- Implement
Valueson tuple by @GuillaumeGomez in https://github.com/askama-rs/askama/pull/391 - generator: make
CARGO_MANIFEST_DIRpart ofConfigKeyby @strickczq in https://github.com/askama-rs/askama/pull/395
- @strickczq made their first contribution in https://github.com/askama-rs/askama/pull/395
Full Changelog: https://github.com/askama-rs/askama/compare/v0.13.0...v0.13.1