aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow macros to be defined and called without argumentsLibravatar mataha2023-06-123-2/+36
| | | | | | | | | | This commit introduces a shorthand for defining and calling macros when using them as a reusable substitute for variables assigned complex values (e.g. string literals with or without newline escapes). The use-case is formatting - from my experience it's easier to visually parse a `macro` `endmacro` block than a multiline variable assignment. Signed-off-by: mataha <mataha@users.noreply.github.com>
* Allow delimiters with arbitrary lengthLibravatar René Kijewski2023-05-312-18/+96
|
* Update criterion requirement from 0.4 to 0.5Libravatar dependabot[bot]2023-05-242-2/+2
| | | | | | | | | | | | | Updates the requirements on [criterion](https://github.com/bheisler/criterion.rs) to permit the latest version. - [Changelog](https://github.com/bheisler/criterion.rs/blob/master/CHANGELOG.md) - [Commits](https://github.com/bheisler/criterion.rs/compare/0.4.0...0.5.0) --- updated-dependencies: - dependency-name: criterion dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
* Upgrade to comrak 0.18Libravatar Dirkjan Ochtman2023-05-203-2/+3
|
* Update to rocket 0.5-rc.3Libravatar Vypo Mouse2023-05-193-7/+22
|
* Improve whitespace documentationLibravatar Raimundo Saona2023-04-031-2/+27
|
* Re-export `askama::*` in `askama_tide` (#802)Libravatar René Kijewski2023-04-012-2/+2
| | | | Every integration crate but `askama_tide` exports `askama::*`. This PR makes `askama_tide` behave the same as every other `integration crate`.
* Use `try_reserve()` instead of `with_capacity()`Libravatar René Kijewski2023-03-311-1/+2
| | | | | | | | | | | | | | `String::with_capacity()` panics if the requested memory could not be allocated. `Template::render()` is fallible method, and the fact that it can panic is not documented. This commit uses `String::try_reserve()` instead, so even for an exceedingly large `SIZE_HINT` the method should not panic. In the generated code `write!()` calls will fail instead with `Err(std::fmt::Error)`. I do not test if `try_reserve()` returned an error, because the rendering might succeed anyway, if less bytes are written than estimated.
* Template::SIZE_HINT: add documentationLibravatar Jacob Hoffman-Andrews2023-03-311-1/+9
|
* Use lookup tableLibravatar René Kijewski2023-03-301-5/+13
|
* Escape HTML fasterLibravatar René Kijewski2023-03-301-29/+23
| | | | | | | | | | | | | | | | | | | | | Escaped HTML characters vary in length. So, in order to select the correct replacement two variables need to be loaded: The pointer to the new substring and its length. Because of this the generated code is less dense than it could be. With this PR instead of selecting the appropriate `&str`, an `&&str` is selected. The former consumes two words while the latter consumes only one. Intuitively one might assume that the double dereference makes the code slower, but the optimized lookup seems to be so much faster, so that the change is worth its weight. Comparing the result of `cargo bench` (best out of three runs for both): ```text Old: [4.3592 µs 4.3675 µs 4.3764 µs] New: [3.8691 µs 3.8766 µs 3.8860 µs] Diff: [-11.24 % -11.24 % -12.21 % ] ```
* Update comrak to 0.17Libravatar Dirkjan Ochtman2023-03-283-3/+4
|
* Update mendes requirement from 0.1.0 to 0.2.0Libravatar dependabot[bot]2023-03-221-1/+1
| | | | | | | | | | | | | Updates the requirements on [mendes](https://github.com/djc/mendes) to permit the latest version. - [Release notes](https://github.com/djc/mendes/releases) - [Commits](https://github.com/djc/mendes/commits) --- updated-dependencies: - dependency-name: mendes dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
* Extract literal from group expressions in attributesLibravatar Dirkjan Ochtman2023-03-211-0/+6
|
* Version bump askama_derive to 0.12.1Libravatar Dirkjan Ochtman2023-03-211-1/+1
|
* Upgrade to syn 2Libravatar Dirkjan Ochtman2023-03-202-28/+27
|
* Add documentation for whitespace argument in template derive proc-macroLibravatar Guillaume Gomez2023-03-131-0/+14
|
* Add tests for whitespace argument in template derive proc-macroLibravatar Guillaume Gomez2023-03-132-0/+54
|
* Add whitespace argument in template derive proc-macroLibravatar Guillaume Gomez2023-03-132-17/+39
|
* Tell user to use `cargo add`Libravatar René Kijewski2023-03-101-5/+3
|
* Update tests for whitespace characters handlingLibravatar Guillaume Gomez2023-03-093-437/+471
|
* Fix handling of trailing whitespace charactersLibravatar Guillaume Gomez2023-03-092-4/+19
|
* Add documentation for + sign in whitespace controlLibravatar Guillaume Gomez2023-03-091-0/+12
|
* Add subsections for configuration chapter (#787)Libravatar Guillaume Gomez2023-03-061-0/+4
|
* Propogate size_hint from sub-blocks (#788)Libravatar Andrew Dona-Couch -- GitHub drop ICE2023-03-065-4/+56
| | | Closes #786
* Bump versions for Askama 0.12 (#784)Libravatar Dirkjan Ochtman2023-03-0310-16/+16
|
* exchange hyper features From<Template> for hyper::Body with TryFromLibravatar Rudi Floren2023-03-032-29/+16
| | | | | | | | | The previous implementation hid the error returned by render, which made it impossible for callers to react to rendering errors. While having a simple way to call into would be nice, there is not way to have both implementations without adding any manual specialization. Thus, the From impl is replaced by the TryFrom impl.
* Fix typosLibravatar René Kijewski2023-02-242-13/+13
|
* Revert "derive: Make Config `'static`"Libravatar René Kijewski2023-02-216-69/+74
|
* Replace `toml_edit` with `basic-toml`Libravatar René Kijewski2023-02-212-3/+3
|
* Add impl From<{Template}> for hyper::Body deriveLibravatar Rudi Floren2023-02-132-6/+62
| | | | | with-hyper now derives an impl allowing Templates to be passed to functions with trait bounds for Into<hyper::Body>.
* Update comrak dependency to 0.16Libravatar René Kijewski2023-01-303-2/+3
|
* derive: refactor parserLibravatar René Kijewski2023-01-305-1940/+1999
| | | | | | | | | | | `parser.rs` was a single file containing almost 2000 lines. This PR split the file into multiple, smaller files. `Expr`, `Node`, and `Target` each get an own file. Each struct gets a `parse()` method that return `Result<Self>`, and every other detail is private to the file. This PR should make this essential part of Askama more easy to understand, and make future modifications easier.
* Extends expects a string and nothing elseLibravatar René Kijewski2023-01-303-5/+5
|
* Use `toml_edit` instead of `toml`Libravatar René Kijewski2023-01-302-3/+4
| | | | | Since version 0.6, `toml` is a wrapper around `toml_edit`, and the more basic library already meets our needs.
* derive: Make Config `'static`Libravatar René Kijewski2023-01-304-71/+67
| | | | | | | The configuration is made `'static`, because `toml` and `toml_edit` both needs to implement serde's `DeserializeOwned` by now. We allocate the strings once per template, so it is very unlikely that this change will have any measurable impact, neither in compile time nor RAM usage.
* Apply clippy suggestions for 1.67 (#769)Libravatar Dirkjan Ochtman2023-01-3025-74/+82
|
* Update `ui` test for trybuild 1.0.76Libravatar René Kijewski2023-01-242-2/+2
| | | | | | | | In <https://github.com/dtolnay/trybuild/pull/219> the output of error messages was subtly changed, because they introduced a subdirectoy in their temp path. This PR fixes the mismatch between the expected and the actual output.
* Apply clippy suggestion for Rust 1.66Libravatar Dirkjan Ochtman2022-12-161-1/+1
|
* Upgrade axum-core to 0.3Libravatar Jonas Platte2022-11-281-2/+2
|
* Extend documentation of custom filtersLibravatar Raimundo Saona2022-11-161-5/+56
|
* Update comrak requirement from 0.14 to 0.15Libravatar dependabot[bot]2022-11-152-2/+2
| | | | | | | | | | | | | | Updates the requirements on [comrak](https://github.com/kivikakk/comrak) to permit the latest version. - [Release notes](https://github.com/kivikakk/comrak/releases) - [Changelog](https://github.com/kivikakk/comrak/blob/main/changelog.txt) - [Commits](https://github.com/kivikakk/comrak/compare/0.14.0...0.15.0) --- updated-dependencies: - dependency-name: comrak dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
* Fail to parse if keyword is not longest identLibravatar René Kijewski2022-11-091-31/+56
| | | | | | | | | | | This PR makes e.g. `{% leta = b %}` a parsing error. To the reader it would appear that `leta` should be a meaningful expression in Askama, which it is not. Before this PR, `leta` was tokenized as `let` + `a`. This PR makes the parser try to find the longest identifier at a parsing positions and only compare the outcome against the expected keyword. This is potentially a breaking change, because code that should always have been invalid will now fail to compile, when it was accepted before.
* chore: remove allow(clippy::disallowed_names)Libravatar Dirkjan Ochtman2022-11-076-9/+1
|
* chore: apply clippy suggestions for 1.65Libravatar Dirkjan Ochtman2022-11-079-70/+70
|
* Fix some minor issues in escape documentation.Libravatar AndrolGenhald2022-11-072-3/+6
|
* Version bump in README and bookLibravatar Allan Zhang2022-10-214-4/+4
| | | | | | | | | I was going through the book when I saw the version was still 0.8. This commit ensures all references to Askama version are to 0.11.2. Most of them already were. Merge whenever appropriate for release, #722 related
* Remove `_ext` from `askama_hyper`, tooLibravatar René Kijewski2022-09-262-5/+4
| | | | | That part was missing from #632, because #632 came before #706, and I forgot to update the older PR.
* Update criterion requirement from 0.3 to 0.4 (#721)Libravatar dependabot[bot]2022-09-262-2/+2
| | | | | | | | | | | | | | | | | Updates the requirements on [criterion](https://github.com/bheisler/criterion.rs) to permit the latest version. - [Release notes](https://github.com/bheisler/criterion.rs/releases) - [Changelog](https://github.com/bheisler/criterion.rs/blob/master/CHANGELOG.md) - [Commits](https://github.com/bheisler/criterion.rs/compare/0.3.0...0.4.0) --- updated-dependencies: - dependency-name: criterion dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Apply clippy suggestions from Rust 1.64 (#725)Libravatar Dirkjan Ochtman2022-09-231-1/+1
|