Otera.Filters (otera v0.1.0)

Copy Markdown View Source

The builtin filters of Jinja2, with their Python behavior.

The filters are abs, attr, batch, capitalize, center, count, default (d), dictsort, escape (e), filesizeformat, first, float, format, groupby, indent, int, items, join, last, length, list, lower, map, max, min, pprint, random, reject, rejectattr, replace, reverse, round, safe, select, selectattr, slice, sort, string, striptags, sum, title, tojson, trim, truncate, unique, upper, urlencode, wordcount, wordwrap and xmlattr.

Without autoescape, safe only converts its value to a string. escape always escapes HTML, as in Jinja2. The filters that give a generator in Jinja2, such as map and select, give a list.

Summary

Functions

Returns true if name is a builtin filter.

Applies the builtin filter name to value. env gives the filters and tests that map and select call.

Functions

builtin?(name)

@spec builtin?(String.t()) :: boolean()

Returns true if name is a builtin filter.

call(name, value, args, kwargs, env)

@spec call(String.t(), term(), list(), Otera.Dict.t(), map()) :: term()

Applies the builtin filter name to value. env gives the filters and tests that map and select call.