From 116d96dd3030a6806115dd3e1c7a17dcb8b80774 Mon Sep 17 00:00:00 2001 From: vallentin Date: Wed, 6 Jan 2021 22:41:02 +0100 Subject: Added missing punctuation and backticks --- book/src/filters.md | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/book/src/filters.md b/book/src/filters.md index fd55898..2dc27b5 100644 --- a/book/src/filters.md +++ b/book/src/filters.md @@ -61,7 +61,7 @@ Output: ### escape | e -Escapes html characters in strings: +Escapes HTML characters in strings: ``` {{ "Escape <>&"|e }} @@ -88,11 +88,11 @@ Output: ### format -Formats arguments according to the specified format +Formats arguments according to the specified format. The first argument to this filter must be a string literal (as in normal Rust). -All arguments are passed through to the format!() macro by the Askama code generator. +All arguments are passed through to the `format!()` macro by the Askama code generator. ``` {{ "{:?}"|format(var) }} @@ -100,7 +100,7 @@ All arguments are passed through to the format!() macro by the Askama code gener ### indent -Indent newlines with width spaces +Indent newlines with width spaces. ``` {{ "hello\nfoo\nbar"|indent(4) }} @@ -116,7 +116,7 @@ hello ### join -Joins iterable into a string separated by provided argument +Joins iterable into a string separated by provided argument. ``` array = &["foo", "bar", "bazz"] @@ -134,9 +134,9 @@ foo, bar, bazz ### linebreaks -Replaces line breaks in plain text with appropriate HTML +Replaces line breaks in plain text with appropriate HTML. -A single newline becomes an HTML line break
and a new line followed by a blank line becomes a paragraph break

. +A single newline becomes an HTML line break `
` and a new line followed by a blank line becomes a paragraph break `

`. ``` {{ "hello\nworld\n\nfrom\naskama"|linebreaks }} @@ -150,7 +150,7 @@ Output: ### linebreaksbr -Converts all newlines in a piece of plain text to HTML line breaks +Converts all newlines in a piece of plain text to HTML line breaks. ``` {{ "hello\nworld\n\nfrom\naskama"|linebreaks }} @@ -164,7 +164,7 @@ hello
world

from
askama ### lower | lowercase -Converts to lowercase +Converts to lowercase. ``` {{ "HELLO"|lower }} @@ -178,7 +178,7 @@ hello ### safe -Marks a string (or other Display type) as safe. By default all strings are escaped according to the format +Marks a string (or other Display type) as safe. By default all strings are escaped according to the format. ``` {{ "

I'm Safe

"|safe }} @@ -192,7 +192,7 @@ Output: ### trim -Strip leading and trailing whitespace +Strip leading and trailing whitespace. ``` {{ " hello "|trim }} @@ -206,7 +206,7 @@ hello ### truncate -Limit string length, appends '...' if truncated +Limit string length, appends '...' if truncated. ``` @@ -221,7 +221,7 @@ he... ### upper | uppercase -Converts to uppercase +Converts to uppercase. ``` {{ "hello"|upper }} @@ -235,12 +235,14 @@ HELLO ### wordcount -Count the words in that string +Count the words in that string. ``` {{ "askama is sort of cool"|wordcount }} ``` +Output: + ``` 5 ``` -- cgit