22 Commits

Author SHA1 Message Date
René Kijewski
f201285ede Use if-let-chains
I ran `cargo +nightly clippy --all-targets --fix  -- -D warnings` and
made only tiny manual improvements.
2025-07-13 23:16:26 +02:00
Markus Ebner
fca6e6f78b
Switch Rust edition of askama_derive to 2024 2025-07-05 03:21:34 +02:00
Markus Ebner
89c4488b66
Prepare local chainmap for caller aliasing 2025-07-05 03:20:10 +02:00
Guillaume Gomez
ca6573bf56 Rename Expr::Attr into Expr::AssociatedItem 2025-06-24 14:09:34 +02:00
René Kijewski
338369a424 parser: box Expr::Filter to reduce Expr's size 2025-06-24 12:21:41 +02:00
René Kijewski
2086d4f898 parser: introduce askama_parser::expr::Call 2025-06-24 12:21:41 +02:00
René Kijewski
49d4397f51 parser: introduce askama_parser::expr::Range 2025-06-24 12:21:41 +02:00
René Kijewski
9f882e2ca7 parser: introduce askama_parser::expr::BinOp 2025-06-24 12:21:41 +02:00
René Kijewski
50e0a96481 Rename LoopItem::index to LoopItem::index0
That's what the element is called in the template syntax.

Also refactor `Generator::visit_attr()` at bit to make it more readable.
Also add `__askama` prefix to `_len`.
2025-06-11 18:53:42 +02:00
René Kijewski
72b9005cb5 filter: modify reject a bit
* Re-use iterator getting from `{% for %}`'s implementation
* Don't use edition 2024 features
2025-06-06 15:48:04 +02:00
René Kijewski
429aaf0821 Escape macro names like loop! 2025-05-23 21:01:00 +02:00
René Kijewski
3e5562dc7c
derive: prefix more generated variables with __askama (#444)
* _did_loop → __askama_did_loop

* _iter → __askama_iter

* bool → askama::helpers::core::primitive::bool

* _loop_item → __askama_item
2025-05-18 23:05:18 +02:00
René Kijewski
ab798e2482 Allow filters with explicit path
IMHO that makes custom filters much easier to use.
2025-05-17 13:20:54 +02:00
René Kijewski
73e8559ca7 loop.first is known by being at index == 0 2025-05-16 16:08:01 +02:00
René Kijewski
b402936db3 generator: add named arguments for filters 2025-04-21 23:11:24 +02:00
René Kijewski
4fe13a0053 generator: add missing lifetimes 2025-04-21 23:11:24 +02:00
René Kijewski
9f9a7dcf43 generator: remove leading _ from method names 2025-04-21 23:11:24 +02:00
René Kijewski
74cb9917a0 generator: move filters into their own file 2025-04-21 23:11:24 +02:00
René Kijewski
7881bc131b Implement first and blank arguments for |indent 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
Guillaume Gomez
3b52c907c3 Rename rinja into askama 2025-03-11 19:31:06 +01:00