1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
pub use Oxiplate;
pub use ;
/// Default Oxiplate experience that uses only built-in filters.
///
/// To use your own filters:
///
/// ```
/// // Create a module named `filters_for_oxiplate` at the root of _your_ crate
/// // to hold the filters.
/// mod filters_for_oxiplate {
/// // Include all of the default filters:
/// // Or just those you want to use:
/// # #[allow(unused_imports)]
/// pub use oxiplate::filters::{upper, *};
///
/// // And then add/import your filters
/// pub fn lower(value: &str) -> String {
/// value.to_lowercase()
/// }
/// }
///
/// // And import those filters where they're needed:
/// mod your_mod {
/// use std::fmt::Error;
///
/// use oxiplate::{Oxiplate, Render};
///
/// #[derive(Oxiplate)]
/// #[oxiplate_inline(html: r#"{{ "Hello World" | lower() }}"#)]
/// struct Data;
///
/// pub fn data() -> Result<(), Error> {
/// assert_eq!(Data.render()?, "hello world");
/// Ok(())
/// }
/// }
/// # fn main() -> Result<(), std::fmt::Error> {
/// # your_mod::data()
/// # }
/// ```