1 | //! Module for built-in filter functions |
2 | //! |
3 | //! Contains all the built-in filter functions for use in templates. |
4 | //! You can define your own filters, as well. |
5 | //! |
6 | //! ## Note |
7 | //! |
8 | //! All **result types of any filter function** in this module is **subject to change** at any |
9 | //! point, and is **not indicated by as semver breaking** version bump. |
10 | //! The traits [`AutoEscape`] and [`WriteWritable`] are used by [`rinja_derive`]'s generated code |
11 | //! to work with all compatible types. |
12 | |
13 | mod builtin; |
14 | mod escape; |
15 | #[cfg (feature = "humansize" )] |
16 | mod humansize; |
17 | #[cfg (feature = "serde_json" )] |
18 | mod json; |
19 | #[cfg (feature = "urlencode" )] |
20 | mod urlencode; |
21 | |
22 | pub use self::builtin::{ |
23 | PluralizeCount, capitalize, center, fmt, format, indent, join, linebreaks, linebreaksbr, lower, |
24 | lowercase, paragraphbreaks, pluralize, title, trim, truncate, upper, uppercase, wordcount, |
25 | }; |
26 | pub use self::escape::{ |
27 | AutoEscape, AutoEscaper, Escaper, FastWritable, Html, HtmlSafe, HtmlSafeOutput, MaybeSafe, |
28 | Safe, Text, Unsafe, Writable, WriteWritable, e, escape, safe, |
29 | }; |
30 | #[cfg (feature = "humansize" )] |
31 | pub use self::humansize::filesizeformat; |
32 | #[cfg (feature = "serde_json" )] |
33 | pub use self::json::{AsIndent, json, json_pretty}; |
34 | #[cfg (feature = "urlencode" )] |
35 | pub use self::urlencode::{urlencode, urlencode_strict}; |
36 | |