521 Commits

Author SHA1 Message Date
René Kijewski
72bbe3ede1 Bump version number to v0.14.0 2025-04-22 23:37:23 +02:00
Guillaume Gomez
6a16256f24 Fix new clippy lints 2025-04-22 11:34:55 +02:00
Guillaume Gomez
04a4d5b020 Update MSRV to 1.83 2025-04-22 11:34:55 +02:00
Guillaume Gomez
6f912abee6 Move FastWritable into askama root 2025-04-22 11:33:57 +02:00
Guillaume Gomez
7c5deda4c1 Rename pluralize arguments into singular and plural 2025-04-21 23:11:24 +02:00
René Kijewski
b402936db3 generator: add named arguments for filters 2025-04-21 23:11:24 +02:00
René Kijewski
4be302338a generator: do argument coercion for |truncate / |center
Don't simply pass any arguments to the filter. The error message won't
be useful otherwise. Also ensure that the argument is a `usize`.
2025-04-21 23:11:24 +02:00
René Kijewski
94fddd4df5 book: add page about FastWritable 2025-04-19 22:09:28 +02:00
René Kijewski
ba33974996 Let |indent use AsIndent 2025-04-17 15:07:21 +02:00
René Kijewski
c6d45e1cdc Always supply values to custom filters 2025-04-15 17:15:47 +02:00
René Kijewski
f7fc39d138 Implement |wordcount filter with access to runtime values 2025-04-15 13:24:19 +02:00
René Kijewski
22648acf08 book: how to access runtime values in custom filters 2025-04-15 13:24:19 +02:00
René Kijewski
20af543610 Pass values through alloc filters, too 2025-04-15 13:24:18 +02:00
René Kijewski
d6bf966048 Pass variables to sub-templates more reliably even if indirectly 2025-04-15 13:13:35 +02:00
Guillaume Gomez
ddfdd20855 Do not put question mark initialization expressions behind a reference 2025-04-12 21:52:14 +02:00
Guillaume Gomez
8081d717d3 If using local variable as value when creating a new variable, do not put it behind a reference 2025-04-11 07:19:59 +02:00
Guillaume Gomez
d3f0947d11 Track config files 2025-03-31 22:41:49 +02:00
René Kijewski
697862a76c Bump version number to 0.13.0 2025-03-27 17:22:37 +01:00
René Kijewski
19f6582308 Bump version number to v0.13.0-pre.0 2025-03-17 21:32:27 +01:00
Guillaume Gomez
3b52c907c3 Rename rinja into askama 2025-03-11 19:31:06 +01:00
René Kijewski
13eea3bd74 derive: fail if requested template block is missing
Previously it was only tested if the block exists if there were any
blocks. If there weren't any, then an empty result would be rendered.
2025-02-08 23:00:54 +01:00
René Kijewski
137aaa0604 derive: implement template attribute blocks 2025-02-08 02:07:01 +01:00
René Kijewski
f0ded0ba32 derive: add span to missing block message 2025-02-07 23:29:04 +01:00
René Kijewski
f759c364f9 derive: no rinja on enum variants 2025-02-07 23:20:12 +01:00
René Kijewski
c13059096e Fix error messages 2025-02-04 22:45:40 +01:00
Guillaume Gomez
f361293da7 Improve macro call arguments mismatch errors 2025-02-04 22:45:40 +01:00
René Kijewski
30e664182d derive: for enums, let Self refer to the original type 2025-02-04 01:24:59 +01:00
René Kijewski
9b8ace77b4 Fix rust 1.86 clippy warnings
* [`manual_div_ceil`]
* [`sliced_string_as_bytes`]
* Add `cargo.toml` for global clippy settings, e.g. msrv

[`manual_div_ceil`]: <https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil>
[`sliced_string_as_bytes`]: <https://rust-lang.github.io/rust-clippy/master/index.html#sliced_string_as_bytes>
2025-01-31 21:22:33 +01:00
René Kijewski
a101903871 Minor clean-ups
* add missing softlinks
* sorted `Cargo.toml`s in root and testing
* suppress warnings in expanded code
2025-01-29 12:30:52 +01:00
René Kijewski
1066c884f3 book: add enum documentation 2025-01-26 02:23:51 +01:00
René Kijewski
5944ab9bef Implement enum variants 2025-01-26 02:23:51 +01:00
René Kijewski
94288391b3 derive: add ".askama" to list of HTML extensions 2025-01-25 20:00:30 +01:00
Guillaume Gomez
b72622120d Add support for "runtime" values 2025-01-23 23:43:43 +01:00
Guillaume Gomez
7947cdcafb Fix ui test 2025-01-12 19:43:39 +01:00
Guillaume Gomez
8d6279d9c8
Merge pull request #279 from GuillaumeGomez/block_in_include
Fix `block_in_include` and add explanations on what is going on
2025-01-01 12:15:33 +01:00
René Kijewski
d254942dbc Add jinja2 tests to verify that jinja2 renders the same 2025-01-01 09:31:52 +01:00
René Kijewski
9336435859 derive: keep track of called macros
Recursive macro calls, direct and indirect, would cause a stackoverflow.

This PR lets the macro call handler keep track of the stack of called
macros we are currently in, so we can abort with an error message
instead of panicking.
2024-12-29 07:52:21 +01:00
René Kijewski
4b8bd45844 parser: use drop guards to track nesting level
Not for all operations the nesting level was incremented when needed
and/or the un-incremented nesting level was used in subfunction calls.
Binary operators such as `*` did not properly increment the nesting
level.

This PR changes `Level` in such a way that it can be used to keep track
of the nesting level when used in a loop. It is now impossible to
accidentally refer to an old nesting level value.

Resolves <https://issues.oss-fuzz.com/issues/385256115>.
2024-12-27 04:31:24 +01:00
Guillaume Gomez
8a20caa136 Fix block_in_include and add explanations on what is going on 2024-12-22 21:11:04 +01:00
René Kijewski
18f1d9b343 parser: deny rust 2024 keyword gen as target name 2024-12-21 23:50:13 +01:00
René Kijewski
c80e78e8b5 parser: deny all rust keywords as target names 2024-12-21 23:49:48 +01:00
Guillaume Gomez
0d91bee794 Update ui tests 2024-12-21 23:06:56 +01:00
René Kijewski
0cc0189927 Add missing softlinks 2024-12-21 19:55:15 +01:00
René Kijewski
e800b7ca90 derive: reserve variable prefix __rinja and free name writer 2024-12-21 19:42:03 +01:00
René Kijewski
fe36573926 Let operator ? only wrap the error in Box if needed
This leads to fewer needless allocations, and makes the operator `?`
usable in an no-alloc context.
2024-12-21 18:53:44 +01:00
René Kijewski
bedc31797c Make #![no_std] compatible 2024-12-21 18:53:44 +01:00
René Kijewski
74bf996ff3 derive: update expected output for newer trybuild versions 2024-12-16 11:46:16 +01:00
Luca Palmieri
f0ac41df30 Reproduce bug with a test 2024-12-15 12:07:11 +01:00
René Kijewski
42b4a1c272 derive: fix typo to not print whole rem file on error 2024-12-13 02:54:43 +01:00
René Kijewski
430b99bdac Fix clippy warnings in rust nightly 1.85 2024-12-11 19:50:29 +01:00