Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: askama-rs/askama
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.13.0
Choose a base ref
...
head repository: askama-rs/askama
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.14.0
Choose a head ref

Commits on Mar 31, 2025

  1. askama_derive accidentally exposed as a feature

    If you don't use an optional dependency at least once with `dep:…` in a
    feature, it automatically, implicitly becomes a feature flag. The
    `dep:` prefix was missing from `askama_derive` for the `derive` feature.
    Kijewski committed Mar 31, 2025
    Copy the full SHA
    68fbf93 View commit details
  2. Merge pull request #384 from Kijewski/pr-derive

    `askama_derive` accidentally exposed as a feature
    GuillaumeGomez authored Mar 31, 2025
    Copy the full SHA
    aa5e200 View commit details
  3. Track config files

    GuillaumeGomez committed Mar 31, 2025
    Copy the full SHA
    d3f0947 View commit details

Commits on Apr 1, 2025

  1. Copy the full SHA
    8344828 View commit details
  2. Add config tracking test

    Kijewski committed Apr 1, 2025
    Copy the full SHA
    dabb537 View commit details
  3. Merge pull request #385 from GuillaumeGomez/track-config-files

    Track config files
    GuillaumeGomez authored Apr 1, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6e987eb View commit details

Commits on Apr 10, 2025

  1. Implement Values on tuple

    GuillaumeGomez authored and Kijewski committed Apr 10, 2025
    Copy the full SHA
    20149db View commit details
  2. Fix runtime error doc

    GuillaumeGomez authored and Kijewski committed Apr 10, 2025
    Copy the full SHA
    4af7a13 View commit details
  3. Add another example for tuple for runtime values

    GuillaumeGomez authored and Kijewski committed Apr 10, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5253e7c View commit details

Commits on Apr 11, 2025

  1. If using local variable as value when creating a new variable, do not…

    … put it behind a reference
    GuillaumeGomez authored and Kijewski committed Apr 11, 2025
    Copy the full SHA
    8081d71 View commit details
  2. Describe declaration/ownership when creating a new variable

    GuillaumeGomez authored and Kijewski committed Apr 11, 2025
    Copy the full SHA
    c76d1a2 View commit details
  3. fix #394

    strickczq authored and Kijewski committed Apr 11, 2025
    Copy the full SHA
    2437a57 View commit details
  4. generator: move manifest_root() call into Config::new()

    Kijewski committed Apr 11, 2025
    Copy the full SHA
    7727d40 View commit details

Commits on Apr 12, 2025

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ddfdd20 View commit details
  2. Update variable initialization rule docs

    GuillaumeGomez authored and Kijewski committed Apr 12, 2025
    Copy the full SHA
    4a17df5 View commit details

Commits on Apr 15, 2025

  1. Copy the full SHA
    d6bf966 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    20af543 View commit details
  3. Copy the full SHA
    22648ac View commit details
  4. Implement |wordcount filter with access to runtime values

    Kijewski committed Apr 15, 2025
    Copy the full SHA
    f7fc39d View commit details
  5. Always supply values to custom filters

    Kijewski committed Apr 15, 2025
    1
    Copy the full SHA
    c6d45e1 View commit details

Commits on Apr 17, 2025

  1. Merge pull request #397 from Kijewski/pr-fast-writable-values

    Pass variables to sub-templates more reliably even if indirectly
    GuillaumeGomez authored Apr 17, 2025
    Copy the full SHA
    2c1e86e View commit details
  2. Let |indent use AsIndent

    Kijewski committed Apr 17, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ba33974 View commit details
  3. Implement first and blank arguments for |indent

    Kijewski committed Apr 17, 2025
    Copy the full SHA
    7881bc1 View commit details

Commits on Apr 19, 2025

  1. book: add page about FastWritable

    Kijewski committed Apr 19, 2025
    Copy the full SHA
    94fddd4 View commit details
  2. Update to more current rust version on readthedocs

    Our documentation needs nightly features `doc_cfg`, `doc_auto_cfg` to
    build. Instead of using the nightly channel, which is not available on
    readthedocs.org, we opt in to nightly features by setting the
    environment variable `RUSTC_BOOTSTRAP` to `1`. This gives on unstable
    features in a stable channel.
    
    Our dependency `proc-macro2` tests if opting-in to unstable feature is
    possible, and if so, it expects that it runs on a quite recent `nightly`
    release. The newest rust version that is available out-of-the-box on
    readthedocs is rust 1.82, which is not *that* recent anymore, being
    released on 2024-08-30.
    
    This PR makes use of the readly configured tool `asdf` to select a more
    recent rust version semi-manually.
    Kijewski committed Apr 19, 2025
    Copy the full SHA
    72c46f4 View commit details

Commits on Apr 20, 2025

  1. Merge pull request #410 from Kijewski/pr-fix-rtd

    Update to more current rust version on readthedocs
    GuillaumeGomez authored Apr 20, 2025
    Copy the full SHA
    7cb3ac0 View commit details
  2. Merge pull request #407 from Kijewski/pr-book-fast-writable

    book: add page about `FastWritable`
    GuillaumeGomez authored Apr 20, 2025
    Copy the full SHA
    4c0398a View commit details
  3. Add throughput to derive benchmark

    Kijewski committed Apr 20, 2025
    Copy the full SHA
    704a33b View commit details

Commits on Apr 21, 2025

  1. Merge pull request #413 from Kijewski/pr-throughput

    Add throughput to derive benchmark
    GuillaumeGomez authored Apr 21, 2025
    Copy the full SHA
    12db32b View commit details
  2. Copy the full SHA
    8fd58a0 View commit details
  3. Copy the full SHA
    74cb991 View commit details
  4. Copy the full SHA
    9f9a7dc View commit details
  5. Copy the full SHA
    4fe13a0 View commit details
  6. Copy the full SHA
    de9d6b7 View commit details
  7. 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`.
    Kijewski committed Apr 21, 2025
    Copy the full SHA
    4be3023 View commit details
  8. Copy the full SHA
    6f8de0c View commit details
  9. Copy the full SHA
    b402936 View commit details
  10. Copy the full SHA
    6cea91a View commit details
  11. Rename pluralize arguments into singular and plural

    GuillaumeGomez authored and Kijewski committed Apr 21, 2025
    Copy the full SHA
    7c5deda View commit details

Commits on Apr 22, 2025

  1. Move FastWritable into askama root

    GuillaumeGomez authored and Kijewski committed Apr 22, 2025
    Copy the full SHA
    6f912ab View commit details
  2. Add unique filter

    GuillaumeGomez authored and Kijewski committed Apr 22, 2025
    Copy the full SHA
    d0d23ca View commit details
  3. Add doc about unique filter

    GuillaumeGomez authored and Kijewski committed Apr 22, 2025
    Copy the full SHA
    d2a788a View commit details
  4. Update MSRV to 1.83

    GuillaumeGomez authored and Kijewski committed Apr 22, 2025
    Copy the full SHA
    04a4d5b View commit details
  5. Fix new clippy lints

    GuillaumeGomez authored and Kijewski committed Apr 22, 2025
    Copy the full SHA
    6a16256 View commit details
  6. Remove usage of nextest

    GuillaumeGomez authored and Kijewski committed Apr 22, 2025
    Copy the full SHA
    7fccbdf View commit details
  7. Fix unique filter implementation

    GuillaumeGomez authored and Kijewski committed Apr 22, 2025
    Copy the full SHA
    a5b43c0 View commit details
  8. book: update upgrading.md

    Kijewski committed Apr 22, 2025
    Copy the full SHA
    5775033 View commit details
  9. Copy the full SHA
    72bbe3e View commit details
  10. Run doctests

    Kijewski committed Apr 22, 2025
    Copy the full SHA
    79be271 View commit details
  11. Add |titlecase as alias for |title

    Kijewski committed Apr 22, 2025
    Copy the full SHA
    61b7422 View commit details
Showing with 3,278 additions and 1,162 deletions.
  1. +5 −11 .github/workflows/rust.yml
  2. +7 −1 .readthedocs.yaml
  3. +4 −4 askama/Cargo.toml
  4. +655 −131 askama/src/filters/alloc.rs
  5. +14 −7 askama/src/filters/builtin.rs
  6. +34 −161 askama/src/filters/escape.rs
  7. +10 −6 askama/src/filters/humansize.rs
  8. +8 −94 askama/src/filters/json.rs
  9. +9 −5 askama/src/filters/mod.rs
  10. +63 −0 askama/src/filters/std.rs
  11. +8 −3 askama/src/filters/urlencode.rs
  12. +21 −5 askama/src/helpers.rs
  13. +197 −4 askama/src/lib.rs
  14. +24 −0 askama/src/values.rs
  15. +3 −3 askama_derive/Cargo.toml
  16. 0 askama_derive/empty_test_config.toml
  17. +40 −30 askama_derive/src/config.rs
  18. +16 −3 askama_derive/src/generator.rs
  19. +60 −565 askama_derive/src/generator/expr.rs
  20. +928 −0 askama_derive/src/generator/filter.rs
  21. +17 −10 askama_derive/src/generator/node.rs
  22. +1 −1 askama_derive/src/input.rs
  23. +7 −3 askama_derive/src/integration.rs
  24. +3 −21 askama_derive/src/lib.rs
  25. +42 −7 askama_derive/src/tests.rs
  26. +5 −5 askama_derive_standalone/Cargo.toml
  27. +13 −4 askama_derive_standalone/benches/derive-template.rs
  28. +1 −0 askama_derive_standalone/empty_test_config.toml
  29. +1 −1 askama_escape/Cargo.toml
  30. +2 −2 askama_parser/Cargo.toml
  31. +9 −1 askama_parser/src/expr.rs
  32. +2 −2 askama_parser/src/lib.rs
  33. +4 −4 bench-build/Cargo.toml
  34. +2 −2 bench-build/README.md
  35. +3 −3 book/src/features.md
  36. +301 −13 book/src/filters.md
  37. +1 −1 book/src/introduction.md
  38. +21 −0 book/src/performance.md
  39. +18 −1 book/src/runtime.md
  40. +11 −0 book/src/template_syntax.md
  41. +18 −5 book/src/upgrading.md
  42. +1 −1 clippy.toml
  43. +2 −2 examples/actix-web-app/Cargo.toml
  44. +2 −2 examples/axum-app/Cargo.toml
  45. +2 −2 examples/poem-app/Cargo.toml
  46. +2 −2 examples/rocket-app/Cargo.toml
  47. +2 −2 examples/salvo-app/Cargo.toml
  48. +2 −2 examples/warp-app/Cargo.toml
  49. +44 −6 fuzzing/fuzz/src/filters.rs
  50. +3 −3 testing-alloc/Cargo.toml
  51. +3 −3 testing-no-std/Cargo.toml
  52. +3 −3 testing-renamed/Cargo.toml
  53. +4 −4 testing/Cargo.toml
  54. +2 −2 testing/benches/all.rs
  55. +51 −0 testing/tests/book_example_performance_fmt_call_fast_writable.rs
  56. +60 −0 testing/tests/book_example_runtime_values_in_custom_filters.rs
  57. +2 −2 testing/tests/filter_block.rs
  58. +32 −2 testing/tests/filters.rs
  59. +1 −1 testing/tests/hello.rs
  60. +188 −0 testing/tests/named_filter_arguments.rs
  61. +3 −3 testing/tests/ui/json-too-many-args.stderr
  62. +48 −0 testing/tests/ui/named_filter_arguments.rs
  63. +39 −0 testing/tests/ui/named_filter_arguments.stderr
  64. +1 −1 testing/tests/ui/no-such-escaper.stderr
  65. +24 −0 testing/tests/ui/truncate.rs
  66. +30 −0 testing/tests/ui/truncate.stderr
  67. +68 −0 testing/tests/values.rs
  68. +71 −0 testing/tests/vars.rs
16 changes: 5 additions & 11 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -205,12 +205,9 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- uses: Swatinem/rust-cache@v2
- run: cargo build --all-targets --features full
- run: cargo nextest run --all-targets --no-tests=warn --features full
- run: cargo test --all-features
- run: cargo test --all-targets --all-features

Package:
needs: ["Rustfmt", "Docs", "Audit", "Book", "Typos", "Jinja2-Assumptions", "DevSkim", "CargoSort"]
@@ -229,12 +226,9 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- uses: Swatinem/rust-cache@v2
- run: cd ${{ matrix.package }} && cargo build --all-targets
- run: cd ${{ matrix.package }} && cargo nextest run --all-targets --no-fail-fast --no-tests=warn
- run: cd ${{ matrix.package }} && cargo test
- run: cd ${{ matrix.package }} && cargo test --all-targets
- run: cd ${{ matrix.package }} && cargo clippy --all-targets -- -D warnings

MSRV:
@@ -246,7 +240,7 @@ jobs:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.81.0"
toolchain: "1.83.0"
- run: cargo check --lib -p askama --all-features

####################################################################################################
8 changes: 7 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -6,8 +6,14 @@ build:
os: ubuntu-lts-latest
tools:
python: "3.12"
rust: "latest"
commands:
# Install a current version of rust
- asdf install rust 1.86.0
- asdf global rust 1.86.0

# proc-macro2 v1.0.95 expects at least nightly-2025-04-16.
- cargo update --package proc-macro2 --precise 1.0.94

# Generate "book/theme/index.hbs" as "skeleton" of the generated pages.
- book/update-theme.py
# Install mdbook.
8 changes: 4 additions & 4 deletions askama/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "askama"
version = "0.13.0"
version = "0.14.0"
description = "Type-safe, compiled Jinja-like templates for Rust"
keywords = ["markup", "template", "jinja2", "html"]
categories = ["template-engine"]
homepage = "https://askama.readthedocs.io/"
repository = "https://github.com/askama-rs/askama"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.81"
rust-version = "1.83"

[package.metadata.docs.rs]
features = ["full"]
@@ -27,7 +27,7 @@ harness = false
itoa = "1.0.11"

# needed by feature "derive"
askama_derive = { version = "=0.13.0", path = "../askama_derive", default-features = false, optional = true }
askama_derive = { version = "=0.14.0", path = "../askama_derive", default-features = false, optional = true }

# needed by feature "serde_json"
serde = { version = "1.0", optional = true, default-features = false }
@@ -56,7 +56,7 @@ alloc = [
blocks = ["askama_derive?/blocks"]
code-in-doc = ["askama_derive?/code-in-doc"]
config = ["askama_derive?/config"]
derive = ["askama_derive"]
derive = ["dep:askama_derive"]
serde_json = ["std", "askama_derive?/serde_json", "dep:serde", "dep:serde_json"]
std = [
"alloc",
Loading