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
Guillaume Gomez
a0e19aa37e
Improve code readability
2025-02-08 19:28:33 +01:00
Guillaume Gomez
77e846fc67
Merge pull request #337 from Kijewski/pr-blocks
...
derive: implement template attribute `blocks`
2025-02-08 11:06:21 +01:00
René Kijewski
137aaa0604
derive: implement template attribute blocks
2025-02-08 02:07:01 +01:00
René Kijewski
24c37c49f0
derive: replace some more format!
with format_args!
2025-02-07 23:47:20 +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
44965f54f5
derive: add option to specify rinja
path
2025-02-04 14:34:46 +01:00
René Kijewski
30e664182d
derive: for enum
s, let Self
refer to the original type
2025-02-04 01:24:59 +01:00
Guillaume Gomez
535df5ee76
Merge pull request #332 from Kijewski/pr-393401467
...
parser: add missing level guard in `if let`
2025-02-01 08:24:30 +01:00
René Kijewski
e1d61276e9
parser: add missing level guard in if let
...
Resolves <https://issues.oss-fuzz.com/issues/393401467 >
2025-02-01 05:35:29 +01:00
René Kijewski
9b0ed3c952
Merge pull request #331 from Kijewski/pr-slice
...
Fix rust 1.86 clippy warnings
2025-01-31 21:49:01 +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
Ed Page
08bc972b2d
chore: Upgrade to Winnow 0.7 ( #330 )
...
* chore: Upgrade to Winnow 0.6.26
* refactor: Resolve deprecations
* refactor: Switch from Parser to ModalParser
* chore: Upgrade to Winnow 0.7
I am not thrilled with the fact that annotations of some kind (I used
no-op `map_err`s here) are needed for the errors and will be digging
into this to better understand why. The code in `toml_edit` is very
similar and yet it doesn't need them.
* refactor: Remove From impl for ErrMode
* refactor: Remove map_err's added to work around 'impl From for ErrMode'
2025-01-31 21:20:20 +01:00
Guillaume Gomez
c0cb411232
Merge pull request #327 from Kijewski/pr-minor-stuff
...
Minor clean-ups
2025-01-29 13:03:56 +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
Guillaume Gomez
e81ca4263e
Merge pull request #255 from Kijewski/pr-enum
...
Implement `enum` variants
2025-01-26 20:22:57 +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
Guillaume Gomez
e418834149
Merge pull request #322 from Kijewski/pr-c37ee6c72e8c9ba008e5090bb3eedfad1a2ae802
...
Remove intermediate allocations for error messages
2025-01-25 23:29:48 +01:00
Guillaume Gomez
836046a8c5
Merge pull request #321 from Kijewski/pr-ext-askama
...
derive: add ".askama" to list of HTML extensions
2025-01-25 23:29:14 +01:00
René Kijewski
d0dcc1c0ce
Remove intermediate allocations for error messages
2025-01-25 20:10:15 +01:00
René Kijewski
94288391b3
derive: add ".askama" to list of HTML extensions
2025-01-25 20:00:30 +01:00
Guillaume Gomez
cae09c50f4
Merge pull request #311 from GuillaumeGomez/runtime-values
...
Add support for "runtime" values
2025-01-24 00:08:43 +01:00
Guillaume Gomez
5257838127
Add new chapter for runtime values
2025-01-23 23:43:43 +01:00
Guillaume Gomez
b72622120d
Add support for "runtime" values
2025-01-23 23:43:43 +01:00
René Kijewski
8253624ad2
Merge pull request #317 from GuillaumeGomez/generics
...
Add support for generics syntax in parser
2025-01-22 22:59:36 +01:00
Guillaume Gomez
1cf81ba269
Simplify filters handling
2025-01-22 22:03:05 +01:00
Guillaume Gomez
0536b0c7c3
Merge pull request #319 from Kijewski/pr-fmt-alloc
...
Make filters `|fmt` and `|format` available with feature `"alloc"`, but without `"std"`
2025-01-21 15:43:02 +01:00
René Kijewski
6bbf0a3b01
Make filters |fmt
and |format
avail w/ "alloc"
w/o "std"
2025-01-21 03:06:50 +01:00
René Kijewski
880be8226d
parser: parse paths in generic arguments
2025-01-20 22:14:28 +01:00
René Kijewski
4b15a6e201
parser: TyGenerics
is recursive, keep track of nesting level
2025-01-20 21:43:56 +01:00
René Kijewski
89ecbb6058
derive: let filters handle generics
2025-01-20 21:17:28 +01:00
René Kijewski
16ce176d1e
parser: count number of &
in type
...
Instead of making it part of the identifier. Otherwise
`normalize_identifier` won't work.
2025-01-20 21:13:08 +01:00
Guillaume Gomez
2969a91123
Add more generics tests
2025-01-18 00:58:12 +01:00
Guillaume Gomez
73bb670df5
Allow to have generics on function calls
2025-01-18 00:55:27 +01:00
Guillaume Gomez
f2e701ee46
Allow generics on filters
2025-01-18 00:48:45 +01:00
Guillaume Gomez
960d039bbf
Support recursive generics
2025-01-18 00:48:45 +01:00
Guillaume Gomez
0bfeb018a7
Add support for ::<>
syntax
2025-01-18 00:48:45 +01:00
Guillaume Gomez
d5c65ab85a
Merge pull request #199 from Kijewski/pr-dyn-compat
...
"object safe" is now "dyn-compatible"
2025-01-16 14:53:45 +01:00
René Kijewski
206231b710
Merge pull request #316 from Kijewski/pr-features
...
book: a features section
2025-01-14 23:53:51 +01:00
René Kijewski
e3f92230cf
Update book/src/introduction.md
...
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2025-01-14 23:34:28 +01:00
René Kijewski
05f483f11f
book: a features section
2025-01-14 20:10:44 +01:00
René Kijewski
651224dc38
book: update a bit
...
* include "Getting stated" in the introduction
* disable run example button because it does not work anyway
* update debug output
* add missing `#[handler]` to actix-web example
* replace `::rinja` with `rinja`
2025-01-14 20:10:27 +01:00
René Kijewski
5c6f61eaf0
Merge pull request #315 from m4tx/patch-1
...
docs: fix recursive example in template_syntax.md
2025-01-14 15:52:28 +01:00
Mateusz Maćkowski
a6548e1186
docs: fix recursive example in template_syntax.md
...
The original description mentions askama issues which is confusing, since they don't exist in rinja repo and, most importantly, the example doesn't compile at all. This fixes both issues.
2025-01-14 15:31:26 +01:00
René Kijewski
32b976216c
Merge pull request #313 from Kijewski/pr-salvo
...
Add salvo example by translating the axum example
2025-01-13 20:35:46 +01:00
René Kijewski
a4527b8424
Make simple forwarding methods #[inline]
2025-01-13 20:30:54 +01:00