From 483281a1161cb52ba89670219672ae2950c99092 Mon Sep 17 00:00:00 2001 From: vallentin Date: Tue, 29 Dec 2020 23:55:48 +0100 Subject: Updated book to include tojson alias --- book/src/filters.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'book/src') diff --git a/book/src/filters.md b/book/src/filters.md index 47fafdb..db660a2 100644 --- a/book/src/filters.md +++ b/book/src/filters.md @@ -262,13 +262,15 @@ Enabling the `serde-json` feature will enable the use of the `json` filter. This will output formatted JSON for any value that implements the required `Serialize` trait. -``` +```jinja { "foo": "{{ foo }}", "bar": {{ bar|json }} } ``` +For compatibility with Jinja, `tojson` can be used in place of `json`. + ## The `yaml` filter Enabling the `serde-yaml` feature will enable the use of the `yaml` filter. -- cgit