-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename rinja
into askama
#353
base: master
Are you sure you want to change the base?
Conversation
a8d2b84
to
5e028ca
Compare
5e028ca
to
e9f9fe0
Compare
@@ -87,7 +87,7 @@ | |||
expected += after[0] * (not nws) | |||
expected += after[1] | |||
|
|||
# FIXME: Rinja does not include whitespace before eof | |||
# FIXME: Askama does not include whitespace before eof |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note test
eb3d6a5
to
037e93e
Compare
I think the soft-links to the config files are still broken. I guess the easiest solution is to recreate them all: ln -fst . ../clippy.toml ../deny.toml ../LICENSE-APACHE ../LICENSE-MIT ../.rustfmt.toml ../tomlfmt.toml ../_typos.toml |
037e93e
to
9513fd4
Compare
I think I'll let you handle the fuzzing part. Normally everything else was done. :) |
Oh, this is a chicken & egg problem I didn't think about. Can you please simply comment out the cluster-fuzz block in the CI? We can comment it back in after we updated the fuzzing config in oss-fuzz. |
I was afraid of something like this. Commenting it out then. |
This is great, thank you! I'll have a proper look tomorrow. (The bvg is on strike, so I'll have to get up early tomorrow to have a nice walk to work. :D) |
Time to buy a bike! :D On my side I'll be on a train back home tomorrow, so should not get to bed too late either. ^^' |
README.md
Outdated
See below for an example. It is a fork of [Askama](https://crates.io/crates/askama), please have a look at our | ||
[blog post](https://blog.guillaume-gomez.fr/articles/2024-07-31+docs.rs+switching+jinja+template+framework+from+tera+to+rinja) | ||
[blog post](https://blog.guillaume-gomez.fr/articles/2024-07-31+docs.rs+switching+jinja+template+framework+from+tera+to+askama) | ||
highlighting differences between the two crates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like "Askama v0.13 the next iteration of rinja v0.3, itself a previous fork of Askama"?
@@ -1,11 +1,11 @@ | |||
[package] | |||
name = "rinja" | |||
name = "askama" | |||
version = "0.3.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version = "0.3.5" | |
version = "0.13.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to do that in another PR. We'll need to update the version before the release in any case.
@@ -27,7 +27,7 @@ harness = false | |||
itoa = "1.0.11" | |||
|
|||
# needed by feature "derive" | |||
rinja_derive = { version = "=0.3.5", path = "../rinja_derive", default-features = false, optional = true } | |||
askama_derive = { version = "=0.3.5", path = "../askama_derive", default-features = false, optional = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
askama_derive = { version = "=0.3.5", path = "../askama_derive", default-features = false, optional = true } | |
askama_derive = { version = "=0.13.0", path = "../askama_derive", default-features = false, optional = true } |
askama/src/lib.rs
Outdated
//! // can easily disable the auto-escaping with the `|safe` filter, | ||
//! // but a malicious user cannot insert e.g. HTML scripts this way. | ||
//! ``` | ||
//! | ||
//! A Rinja template is a `struct` definition which provides the template | ||
//! A Askama template is a `struct` definition which provides the template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//! A Askama template is a `struct` definition which provides the template | |
//! An Askama template is a `struct` or `enum` definition which provides the template |
askama_derive/src/config.rs
Outdated
static DEFAULT_SYNTAX_NAME: &str = "default"; | ||
static DEFAULT_ESCAPERS: &[(&[&str], &str)] = &[ | ||
( | ||
&[ | ||
"askama", "html", "htm", "j2", "jinja", "jinja2", "rinja", "svg", "xml", | ||
"askama", "html", "htm", "j2", "jinja", "jinja2", "askama", "svg", "xml", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"askama", "html", "htm", "j2", "jinja", "jinja2", "askama", "svg", "xml", | |
"askama", "html", "htm", "j2", "jinja", "jinja2", "svg", "xml", |
askama_derive/src/config.rs
Outdated
@@ -651,13 +651,13 @@ mod tests { | |||
(str_set(&["js"]), "::my_filters::Js".into()), | |||
( | |||
str_set(&[ | |||
"askama", "html", "htm", "j2", "jinja", "jinja2", "rinja", "svg", "xml" | |||
"askama", "html", "htm", "j2", "jinja", "jinja2", "askama", "svg", "xml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"askama", "html", "htm", "j2", "jinja", "jinja2", "askama", "svg", "xml" | |
"askama", "html", "htm", "j2", "jinja", "jinja2", "svg", "xml" |
askama_derive/src/input.rs
Outdated
@@ -1055,7 +1055,7 @@ const _: () = { | |||
}; | |||
|
|||
#[cfg(feature = "code-in-doc")] | |||
const JINJA_EXTENSIONS: &[&str] = &["askama", "j2", "jinja", "jinja2", "rinja"]; | |||
const JINJA_EXTENSIONS: &[&str] = &["askama", "j2", "jinja", "jinja2", "askama"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const JINJA_EXTENSIONS: &[&str] = &["askama", "j2", "jinja", "jinja2", "askama"]; | |
const JINJA_EXTENSIONS: &[&str] = &["askama", "j2", "jinja", "jinja2"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll actually keep rinja for memories. :)
[package] | ||
name = "rinja_derive_standalone" | ||
name = "askama_derive_standalone" | ||
version = "0.3.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version = "0.3.5" | |
version = "0.13.0" |
@@ -21,7 +20,7 @@ harness = false | |||
required-features = ["__standalone"] | |||
|
|||
[dependencies] | |||
parser = { package = "rinja_parser", version = "=0.3.5", path = "../rinja_parser" } | |||
parser = { package = "askama_parser", version = "=0.3.5", path = "../askama_parser" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parser = { package = "askama_parser", version = "=0.3.5", path = "../askama_parser" } | |
parser = { package = "askama_parser", version = "=0.13.0", path = "../askama_parser" } |
@@ -1,12 +1,12 @@ | |||
[package] | |||
name = "rinja_parser" | |||
name = "askama_parser" | |||
version = "0.3.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version = "0.3.5" | |
version = "0.13.0" |
@@ -1,18 +1,18 @@ | |||
[package] | |||
name = "bench-build" | |||
version = "0.3.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version = "0.3.5" | |
version = "0.13.0" |
askama = { path = "../askama", version = "0.3.5", default-features = false, features = ["std"] } | ||
askama_derive = { path = "../askama_derive", version = "0.3.5", features = ["std"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
askama = { path = "../askama", version = "0.3.5", default-features = false, features = ["std"] } | |
askama_derive = { path = "../askama_derive", version = "0.3.5", features = ["std"] } | |
askama = { path = "../askama", version = "0.13.0", default-features = false, features = ["std"] } | |
askama_derive = { path = "../askama_derive", version = "0.13.0", features = ["std"] } |
@@ -9,7 +9,7 @@ you have to opt-in to the feature [`"serde_json"`](#serde_json): | |||
|
|||
```toml | |||
[dependencies] | |||
rinja = { version = "0.3.5", features = ["serde_json"] } | |||
askama = { version = "0.3.5", features = ["serde_json"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
askama = { version = "0.3.5", features = ["serde_json"] } | |
askama = { version = "0.13.0", features = ["serde_json"] } |
@@ -18,7 +18,7 @@ for more information. | |||
## Default features | |||
|
|||
Any [semver-compatible](https://doc.rust-lang.org/cargo/reference/semver.html) upgrade | |||
(e.g. `rinja = "0.3.4"` to `rinja = "0.3.5"`) will keep the same list of default features. | |||
(e.g. `askama = "0.3.4"` to `askama = "0.3.5"`) will keep the same list of default features. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(e.g. `askama = "0.3.4"` to `askama = "0.3.5"`) will keep the same list of default features. | |
(e.g. `askama = "0.13.0"` to `askama = "0.13.1"`) will keep the same list of default features. |
@@ -28,7 +28,7 @@ You can opt-out of using the feature flags by using | |||
|
|||
```toml | |||
[dependencies] | |||
rinja = { version = "0.3.5", default-features = false } | |||
askama = { version = "0.3.5", default-features = false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
askama = { version = "0.3.5", default-features = false } | |
askama = { version = "0.13.0", default-features = false } |
|
||
## Getting Started | ||
|
||
First, add the following to your crate's `Cargo.toml`: | ||
|
||
```toml | ||
# in [dependencies] section | ||
rinja = "0.3.5" | ||
askama = "0.3.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
askama = "0.3.5" | |
askama = "0.13.0" |
book/src/performance.md
Outdated
@@ -2,21 +2,21 @@ | |||
|
|||
## Rendering Performance | |||
|
|||
When rendering a rinja template, you should prefer the methods | |||
When rendering a askama template, you should prefer the methods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When rendering a askama template, you should prefer the methods | |
When rendering an askama template, you should prefer the methods |
book/src/upgrading.md
Outdated
@@ -46,26 +46,26 @@ give you more in-dept explanations: | |||
* The feature `"serde-yaml"` was removed. | |||
Use e.g. [`yaml-rust2`](https://lib.rs/crates/yaml-rust2) directly. | |||
|
|||
## From rinja v0.3 to askama v0.13 | |||
## From askama v0.3 to askama v0.13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please undo all changes in this file below this line.
examples/actix-web-app/src/main.rs
Outdated
@@ -65,7 +65,7 @@ impl Responder for AppError { | |||
type Body = String; | |||
|
|||
fn respond_to(self, req: &HttpRequest) -> HttpResponse<Self::Body> { | |||
// The error handler uses a rinja template to display its content. | |||
// The error handler uses a askama template to display its content. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// The error handler uses a askama template to display its content. | |
// The error handler uses an askama template to display its content. |
# and axum as your web-framework. | ||
[dependencies] | ||
askama = { version = "0.3.5", path = "../../askama" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
askama = { version = "0.3.5", path = "../../askama" } | |
askama = { version = "0.13.0", path = "../../askama" } |
examples/axum-app/src/main.rs
Outdated
} | ||
|
||
/// This is your error handler | ||
impl IntoResponse for AppError { | ||
fn into_response(self) -> Response { | ||
// It uses a rinja template to display its content. | ||
// It uses a askama template to display its content. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// It uses a askama template to display its content. | |
// It uses an askama template to display its content. |
# and poem as your web-framework. | ||
[dependencies] | ||
askama = { version = "0.3.5", path = "../../askama" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
askama = { version = "0.3.5", path = "../../askama" } | |
askama = { version = "0.13.0", path = "../../askama" } |
examples/poem-app/src/main.rs
Outdated
@@ -71,7 +71,7 @@ impl ResponseError for AppError { | |||
/// This is your error handler | |||
impl IntoResponse for AppError { | |||
fn into_response(self) -> Response { | |||
// It uses a rinja template to display its content. | |||
// It uses a askama template to display its content. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// It uses a askama template to display its content. | |
// It uses an askama template to display its content. |
# and rocket as your web-framework. | ||
[dependencies] | ||
rinja = { version = "0.3.5", path = "../../rinja" } | ||
askama = { version = "0.3.5", path = "../../askama" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
askama = { version = "0.3.5", path = "../../askama" } | |
askama = { version = "0.13.0", path = "../../askama" } |
examples/rocket-app/src/main.rs
Outdated
} | ||
|
||
/// This is your error handler | ||
impl<'r> Responder<'r, 'static> for AppError { | ||
fn respond_to(self, request: &'r Request<'_>) -> Result<Response<'static>, Status> { | ||
// It uses a rinja template to display its content. | ||
// It uses a askama template to display its content. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// It uses a askama template to display its content. | |
// It uses a askama template to display its content. |
# and salvo as your web-framework. | ||
[dependencies] | ||
rinja = { version = "0.3.5", path = "../../rinja" } | ||
askama = { version = "0.3.5", path = "../../askama" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
askama = { version = "0.3.5", path = "../../askama" } | |
askama = { version = "0.13.0", path = "../../askama" } |
examples/salvo-app/src/main.rs
Outdated
} | ||
|
||
/// This is your error handler | ||
impl Scribe for AppError { | ||
fn render(self, res: &mut Response) { | ||
// It uses a rinja template to display its content. | ||
// It uses a askama template to display its content. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// It uses a askama template to display its content. | |
// It uses a askama template to display its content. |
# and actix-web as your web-framework. | ||
[dependencies] | ||
askama = { version = "0.3.5", path = "../../askama" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
askama = { version = "0.3.5", path = "../../askama" } | |
askama = { version = "0.13.0", path = "../../askama" } |
examples/warp-app/src/main.rs
Outdated
} | ||
|
||
/// This is your error handler | ||
impl Reply for AppError { | ||
fn into_response(self) -> Response { | ||
// It uses a rinja template to display its content. | ||
// It uses a askama template to display its content. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// It uses a askama template to display its content. | |
// It uses a askama template to display its content. |
@@ -1,12 +1,12 @@ | |||
[package] | |||
name = "rinja_testing-alloc" | |||
name = "askama_testing-alloc" | |||
version = "0.3.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version = "0.3.5" | |
version = "0.13.0" |
edition = "2021" | ||
rust-version = "1.81" | ||
publish = false | ||
|
||
[dev-dependencies] | ||
rinja = { path = "../rinja", version = "0.3.5", default-features = false, features = ["alloc", "derive"] } | ||
askama = { path = "../askama", version = "0.3.5", default-features = false, features = ["alloc", "derive"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
askama = { path = "../askama", version = "0.3.5", default-features = false, features = ["alloc", "derive"] } | |
askama = { path = "../askama", version = "0.13.0", default-features = false, features = ["alloc", "derive"] } |
@@ -1,12 +1,12 @@ | |||
[package] | |||
name = "rinja_testing-no-std" | |||
name = "askama_testing-no-std" | |||
version = "0.3.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version = "0.3.5" | |
version = "0.13.0" |
edition = "2021" | ||
rust-version = "1.81" | ||
publish = false | ||
|
||
[dev-dependencies] | ||
rinja = { path = "../rinja", version = "0.3.5", default-features = false, features = ["derive"] } | ||
askama = { path = "../askama", version = "0.3.5", default-features = false, features = ["derive"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
askama = { path = "../askama", version = "0.3.5", default-features = false, features = ["derive"] } | |
askama = { path = "../askama", version = "0.13.0", default-features = false, features = ["derive"] } |
I really should have made a commit instead of supplying suggestions in Github. :| Maybe hit "commit suggestion" a lot, then squash the commits manually? :) |
588e081
to
20a899f
Compare
20a899f
to
690d908
Compare
Part of #335.