4 releases

0.1.3 Jan 26, 2020
0.1.2 Apr 28, 2019
0.1.1 Apr 23, 2019
0.1.0 Apr 23, 2019

#1461 in Text processing

Download history 26/week @ 2023-11-27 13/week @ 2023-12-04 17/week @ 2023-12-11 13/week @ 2023-12-18 17/week @ 2023-12-25 35/week @ 2024-01-01 30/week @ 2024-01-08 43/week @ 2024-01-15 15/week @ 2024-01-22 33/week @ 2024-01-29 34/week @ 2024-02-05 49/week @ 2024-02-12 60/week @ 2024-02-19 93/week @ 2024-02-26 43/week @ 2024-03-04 59/week @ 2024-03-11

259 downloads per month
Used in 2 crates

MIT license

16KB
337 lines

Askama Filters

Additional template filters for the Askama templating library.

Using

This library is intended to be used alongside Askama and is effectively useless without it.

Inside any module that is defining an Askama Template just use askama_filters::filters; and they will be available in the HTML template.

If you wish to use this library in addition to your own filters create a module named filters and add use askama_filters::filters::* to it. Then import that module wherever you are creating Templates and both sets of filters should be available.

Building

This is a standard Rust project so just use:

$ cargo build

Features

  • markdown: adds the markdown and md filters which can be used to convert plain-text to HTML. It is intended to be used like this:

    {{ raw|e|md|safe }}
    

    with the e escaping, and the safe marking the resultant HTML as safe.

  • chrono adds the date filter for date and time formatting.

Contributing / Issues

Please email any issues or patches to rushteve1 at rushsteve1.us.

Dependencies

~2.4–4MB
~70K SLoC