Function wordcount

Source
pub fn wordcount(s: impl Display) -> Result<usize, Error>
Expand description

Count the words in that string.

/// ```jinja
/// <div>{{ example|wordcount }}</div>
/// ```
#[derive(Template)]
#[template(ext = "html", in_doc = true)]
struct Example<'a> {
    example: &'a str,
}

assert_eq!(
    Example { example: "askama is sort of cool" }.to_string(),
    "<div>5</div>"
);