Skip to content

Commit 95867ac

Browse files
Merge pull request #416 from Kijewski/pr-upgrading-0.14
Get ready for v0.14.0
2 parents a5b43c0 + 61b7422 commit 95867ac

File tree

24 files changed

+88
-48
lines changed

24 files changed

+88
-48
lines changed

.github/workflows/rust.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ jobs:
206206
with:
207207
toolchain: ${{ matrix.rust }}
208208
- uses: Swatinem/rust-cache@v2
209-
- run: cargo build --all-targets --features full
210-
- run: cargo test --all-targets --features full
209+
- run: cargo test --all-features
210+
- run: cargo test --all-targets --all-features
211211

212212
Package:
213213
needs: ["Rustfmt", "Docs", "Audit", "Book", "Typos", "Jinja2-Assumptions", "DevSkim", "CargoSort"]
@@ -227,7 +227,7 @@ jobs:
227227
with:
228228
components: clippy
229229
- uses: Swatinem/rust-cache@v2
230-
- run: cd ${{ matrix.package }} && cargo build --all-targets
230+
- run: cd ${{ matrix.package }} && cargo test
231231
- run: cd ${{ matrix.package }} && cargo test --all-targets
232232
- run: cd ${{ matrix.package }} && cargo clippy --all-targets -- -D warnings
233233

askama/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "askama"
3-
version = "0.13.0"
3+
version = "0.14.0"
44
description = "Type-safe, compiled Jinja-like templates for Rust"
55
keywords = ["markup", "template", "jinja2", "html"]
66
categories = ["template-engine"]
@@ -27,7 +27,7 @@ harness = false
2727
itoa = "1.0.11"
2828

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

3232
# needed by feature "serde_json"
3333
serde = { version = "1.0", optional = true, default-features = false }

askama/src/filters/alloc.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,31 @@ fn flush_title(dest: &mut (impl fmt::Write + ?Sized), s: &str) -> fmt::Result {
820820
Ok(())
821821
}
822822

823+
/// Return a title cased version of the value. Alias for the [`|title`](title) filter.
824+
///
825+
/// ```
826+
/// # #[cfg(feature = "code-in-doc")] {
827+
/// # use askama::Template;
828+
/// /// ```jinja
829+
/// /// <div>{{ example|titlecase }}</div>
830+
/// /// ```
831+
/// #[derive(Template)]
832+
/// #[template(ext = "html", in_doc = true)]
833+
/// struct Example<'a> {
834+
/// example: &'a str,
835+
/// }
836+
///
837+
/// assert_eq!(
838+
/// Example { example: "hello WORLD" }.to_string(),
839+
/// "<div>Hello World</div>"
840+
/// );
841+
/// # }
842+
/// ```
843+
#[inline]
844+
pub fn titlecase<S: fmt::Display>(source: S) -> Result<Title<S>, Infallible> {
845+
title(source)
846+
}
847+
823848
/// A prefix usable for indenting [prettified JSON data](super::json::json_pretty) and
824849
/// [`|indent`](indent)
825850
///

askama/src/filters/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mod urlencode;
2525
#[cfg(feature = "alloc")]
2626
pub use self::alloc::{
2727
AsIndent, capitalize, fmt, format, indent, linebreaks, linebreaksbr, lower, lowercase,
28-
paragraphbreaks, title, trim, upper, uppercase, wordcount,
28+
paragraphbreaks, title, titlecase, trim, upper, uppercase, wordcount,
2929
};
3030
pub use self::builtin::{PluralizeCount, center, join, pluralize, truncate};
3131
pub use self::escape::{

askama_derive/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "askama_derive"
3-
version = "0.13.0"
3+
version = "0.14.0"
44
description = "Procedural macro package for Askama"
55
homepage = "https://github.com/askama-rs/askama"
66
repository = "https://github.com/askama-rs/askama"
@@ -17,7 +17,7 @@ rustdoc-args = ["--generate-link-to-definition", "--cfg=docsrs"]
1717
proc-macro = true
1818

1919
[dependencies]
20-
parser = { package = "askama_parser", version = "=0.13.0", path = "../askama_parser" }
20+
parser = { package = "askama_parser", version = "=0.14.0", path = "../askama_parser" }
2121

2222
basic-toml = { version = "0.1.1", optional = true }
2323
pulldown-cmark = { version = "0.13.0", optional = true, default-features = false }

askama_derive/src/generator/filter.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,7 @@ const BUILTIN_FILTERS_ALLOC: &[&str] = &[
918918
"lower",
919919
"lowercase",
920920
"title",
921+
"titlecase",
921922
"trim",
922923
"upper",
923924
"uppercase",

askama_derive_standalone/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "askama_derive_standalone"
3-
version = "0.13.0"
3+
version = "0.14.0"
44
description = "Procedural macro package for Askama"
55
homepage = "https://github.com/askama-rs/askama"
66
repository = "https://github.com/askama-rs/askama"
@@ -20,7 +20,7 @@ harness = false
2020
required-features = ["__standalone"]
2121

2222
[dependencies]
23-
parser = { package = "askama_parser", version = "=0.13.0", path = "../askama_parser" }
23+
parser = { package = "askama_parser", version = "=0.14.0", path = "../askama_parser" }
2424

2525
basic-toml = { version = "0.1.1", optional = true }
2626
pulldown-cmark = { version = "0.13.0", optional = true, default-features = false }

askama_parser/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "askama_parser"
3-
version = "0.13.0"
3+
version = "0.14.0"
44
description = "Parser for Askama templates"
55
documentation = "https://docs.rs/askama"
66
keywords = ["markup", "template", "jinja2", "html"]

bench-build/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
22
name = "bench-build"
3-
version = "0.13.0"
3+
version = "0.14.0"
44
authors = ["askama-rs developers"]
55
edition = "2021"
66
rust-version = "1.83"
77
publish = false
88

99
[dependencies]
10-
askama = { path = "../askama", version = "0.13.0", default-features = false, features = ["std"] }
11-
askama_derive = { path = "../askama_derive", version = "0.13.0", features = ["std"] }
10+
askama = { path = "../askama", version = "0.14.0", default-features = false, features = ["std"] }
11+
askama_derive = { path = "../askama_derive", version = "0.14.0", features = ["std"] }
1212

1313
[features]
1414
default = []

bench-build/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ Without the feature, `cargo` will be able to compile more dependencies in parall
4141
```toml
4242
# Cargo.toml
4343
[dependencies]
44-
askama = { version = "0.13.0", default-features = false, features = ["std"] }
45-
askama_derive = { version = "0.13.0", features = ["std"] }
44+
askama = { version = "0.14.0", default-features = false, features = ["std"] }
45+
askama_derive = { version = "0.14.0", features = ["std"] }
4646
```
4747

4848
```rust

0 commit comments

Comments
 (0)