Skip to content

Commit 46cd48b

Browse files
Merge pull request #725 from GuillaumeGomez/custom-escaper
Add custom escaper example
2 parents 393b51d + 63962f5 commit 46cd48b

16 files changed

Lines changed: 97 additions & 20 deletions

File tree

.github/workflows/rust.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- run: |
3131
set -eu
3232
for PKG in \
33-
bench-build examples/actix-web-app examples/axum-app examples/poem-app examples/rocket-app examples/warp-app fuzzing \
33+
bench-build examples/actix-web-app examples/axum-app examples/poem-app examples/rocket-app examples/warp-app examples/custom-escaper fuzzing \
3434
askama askama_derive askama_escape askama_macros askama_parser \
3535
testing testing-alloc testing-no-std testing-renamed
3636
do
@@ -129,7 +129,7 @@ jobs:
129129
cargo sort --check --check-format --grouped
130130
set -eu
131131
for PKG in \
132-
bench-build examples/actix-web-app examples/axum-app examples/poem-app examples/rocket-app examples/warp-app fuzzing \
132+
bench-build examples/actix-web-app examples/axum-app examples/poem-app examples/rocket-app examples/warp-app examples/custom-escaper fuzzing \
133133
askama askama_derive askama_escape askama_macros askama_parser \
134134
testing testing-alloc testing-no-std testing-renamed
135135
do
@@ -171,7 +171,7 @@ jobs:
171171
strategy:
172172
matrix:
173173
package: [
174-
bench-build, examples/actix-web-app, examples/axum-app, examples/poem-app, examples/rocket-app, examples/warp-app, fuzzing,
174+
bench-build, examples/actix-web-app, examples/axum-app, examples/poem-app, examples/rocket-app, examples/warp-app, examples/custom-escaper, fuzzing,
175175
askama, askama_derive, askama_escape, askama_macros, askama_parser,
176176
testing, testing-alloc, testing-no-std, testing-renamed,
177177
]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# askama
22

33
[![Crates.io](https://img.shields.io/crates/v/askama?logo=rust&style=flat-square&logoColor=white "Crates.io")](https://crates.io/crates/askama)
4-
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/askama-rs/askama/rust.yml?branch=master&logo=github&style=flat-square&logoColor=white "GitHub Workflow Status")](https://github.com/askama-rs/askama/actions/workflows/rust.yml)
4+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/askama-rs/askama/rust.yml?branch=main&logo=github&style=flat-square&logoColor=white "GitHub Workflow Status")](https://github.com/askama-rs/askama/actions/workflows/rust.yml)
55
[![Book](https://img.shields.io/readthedocs/askama?label=book&logo=readthedocs&style=flat-square&logoColor=white "Book")](https://askama.rs/)
66
[![docs.rs](https://img.shields.io/docsrs/askama?logo=docsdotrs&style=flat-square&logoColor=white "docs.rs")](https://docs.rs/askama/)
77

askama/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! [![Crates.io](https://img.shields.io/crates/v/askama?logo=rust&style=flat-square&logoColor=white "Crates.io")](https://crates.io/crates/askama)
2-
//! [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/askama-rs/askama/rust.yml?branch=master&logo=github&style=flat-square&logoColor=white "GitHub Workflow Status")](https://github.com/askama-rs/askama/actions/workflows/rust.yml)
2+
//! [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/askama-rs/askama/rust.yml?branch=main&logo=github&style=flat-square&logoColor=white "GitHub Workflow Status")](https://github.com/askama-rs/askama/actions/workflows/rust.yml)
33
//! [![Book](https://img.shields.io/readthedocs/askama?label=book&logo=readthedocs&style=flat-square&logoColor=white "Book")](https://askama.rs/)
44
//! [![docs.rs](https://img.shields.io/docsrs/askama?logo=docsdotrs&style=flat-square&logoColor=white "docs.rs")](https://docs.rs/askama/)
55
//!
@@ -10,7 +10,7 @@
1010
//! in [`askama_macros`](https://crates.io/crates/askama_macros)).
1111
//!
1212
//! For feature highlights and a quick start, please review the
13-
//! [README](https://github.com/askama-rs/askama/blob/master/README.md).
13+
//! [README](https://github.com/askama-rs/askama/blob/main/README.md).
1414
//!
1515
//! You can find the documentation about our syntax, features, configuration in our book:
1616
//! [askama.rs](https://askama.rs/).

askama_derive/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# askama_derive: code generator of Askama templating engine
22

33
[![Crates.io](https://img.shields.io/crates/v/askama_derive?logo=rust&style=flat-square&logoColor=white "Crates.io")](https://crates.io/crates/askama_derive)
4-
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/askama-rs/askama/rust.yml?branch=master&logo=github&style=flat-square&logoColor=white "GitHub Workflow Status")](https://github.com/askama-rs/askama/actions/workflows/rust.yml)
4+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/askama-rs/askama/rust.yml?branch=main&logo=github&style=flat-square&logoColor=white "GitHub Workflow Status")](https://github.com/askama-rs/askama/actions/workflows/rust.yml)
55
[![Book](https://img.shields.io/readthedocs/askama?label=book&logo=readthedocs&style=flat-square&logoColor=white "Book")](https://askama.rs/)
66
[![docs.rs](https://img.shields.io/docsrs/askama_derive?logo=docsdotrs&style=flat-square&logoColor=white "docs.rs")](https://docs.rs/askama_derive/)
77

askama_escape/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# askama_escape: HTML escaping, extracted from [Askama](https://askama.rs/)
22

33
[![Crates.io](https://img.shields.io/crates/v/askama_escape?logo=rust&style=flat-square&logoColor=white "Crates.io")](https://crates.io/crates/askama_escape)
4-
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/askama-rs/askama/rust.yml?branch=master&logo=github&style=flat-square&logoColor=white "GitHub Workflow Status")](https://github.com/askama-rs/askama/actions/workflows/rust.yml)
4+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/askama-rs/askama/rust.yml?branch=main&logo=github&style=flat-square&logoColor=white "GitHub Workflow Status")](https://github.com/askama-rs/askama/actions/workflows/rust.yml)
55
[![docs.rs](https://img.shields.io/docsrs/askama_escape?logo=docsdotrs&style=flat-square&logoColor=white "docs.rs")](https://docs.rs/askama_escape/)
66

77
Useful if you don't need a template engine, but if you need to escape a text for HTML or XML.

askama_macros/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# askama_macros: procedural macros for the Askama templating engine
22

33
[![Crates.io](https://img.shields.io/crates/v/askama_macros?logo=rust&style=flat-square&logoColor=white "Crates.io")](https://crates.io/crates/askama_macros)
4-
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/askama-rs/askama/rust.yml?branch=master&logo=github&style=flat-square&logoColor=white "GitHub Workflow Status")](https://github.com/askama-rs/askama/actions/workflows/rust.yml)
4+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/askama-rs/askama/rust.yml?branch=main&logo=github&style=flat-square&logoColor=white "GitHub Workflow Status")](https://github.com/askama-rs/askama/actions/workflows/rust.yml)
55
[![Book](https://img.shields.io/readthedocs/askama?label=book&logo=readthedocs&style=flat-square&logoColor=white "Book")](https://askama.rs/)
66
[![docs.rs](https://img.shields.io/docsrs/askama_macros?logo=docsdotrs&style=flat-square&logoColor=white "docs.rs")](https://docs.rs/askama_macros/)
77

askama_parser/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# askama_parser: template parser for the Askama templating engine
22

33
[![Crates.io](https://img.shields.io/crates/v/askama_parser?logo=rust&style=flat-square&logoColor=white "Crates.io")](https://crates.io/crates/askama_parser)
4-
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/askama-rs/askama/rust.yml?branch=master&logo=github&style=flat-square&logoColor=white "GitHub Workflow Status")](https://github.com/askama-rs/askama/actions/workflows/rust.yml)
4+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/askama-rs/askama/rust.yml?branch=main&logo=github&style=flat-square&logoColor=white "GitHub Workflow Status")](https://github.com/askama-rs/askama/actions/workflows/rust.yml)
55
[![Book](https://img.shields.io/readthedocs/askama?label=book&logo=readthedocs&style=flat-square&logoColor=white "Book")](https://askama.rs/)
66
[![docs.rs](https://img.shields.io/docsrs/askama_parser?logo=docsdotrs&style=flat-square&logoColor=white "docs.rs")](https://docs.rs/askama_parser/)
77

askama_parser/benches/librustdoc/LICENSE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ eeb59f16a5f40e14dc29b95155b7f2569329e3ec. Dual licensed under MIT OR Apache-2.0.
33

44
Please find the authors in [their Git history].
55

6-
[librustdoc/html/templates]: <https://github.com/rust-lang/rust/tree/master/src/librustdoc/html/templates>
7-
[their Git history]: <https://github.com/rust-lang/rust/commits/master/src/librustdoc/html/templates>
6+
[librustdoc/html/templates]: <https://github.com/rust-lang/rust/tree/main/src/librustdoc/html/templates>
7+
[their Git history]: <https://github.com/rust-lang/rust/commits/main/src/librustdoc/html/templates>

book/book.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ title = "Askama"
88
edition = "2021"
99

1010
[output.html]
11-
git-repository-url = "https://github.com/askama-rs/askama/tree/master/book"
12-
edit-url-template = "https://github.com/askama-rs/askama/tree/master/book/{path}"
11+
git-repository-url = "https://github.com/askama-rs/askama/tree/main/book"
12+
edit-url-template = "https://github.com/askama-rs/askama/tree/main/book/{path}"
1313
playground.runnable = false

book/src/configuration.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,7 @@ extensions = ["js"]
151151
[`Escaper`] trait so since we don't need want any escaping on our `.js` files, we use
152152
it.
153153

154+
You can take a look at the [custom escaper example] in the `askama` repository.
155+
154156
[`Escaper`]: https://docs.rs/askama/latest/askama/filters/trait.Escaper.html
157+
[custom escaper example]: https://github.com/askama-rs/askama/tree/main/examples/warp-app

0 commit comments

Comments
 (0)