[][src]Crate askama_filters

Askama Filters

A collection of additional template filters for the Askama templating engine


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.

A number of filters in this library return HTML markup. For security reasons these are not automatically considered safe and you most likely will want to chain them with the safe filter like so var|markdown|safe. Escaping inbetween is also recommeneded such as var|e|md|safe.


There are a few optional features that can be enabled:

  • markdown: Markdown parsing using a filter.
  • date: Parse and format date/time strings.



The main collection of filters. These filters do not require a feature flag.



Type Definitions