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
58
59
60
61
//! # fluskama
//!
//! an [askama](https://github.com/djc/askama) wrapper for the [fluffer](https://codeberg.org/catboomer/fluffer)
//! gemini server framework. it eases serving gemini pages written in
//! askama by creating a wrapper for askama's template type.
//!
//! ## wrapping a template
//! as previously mentioned, fluskama works as a wrapper for any askama templates. in order to wrap a template,
//! we can call `FluffTemplate::from()`
//!
//! ```rust
//! use fluskama::FluffTemplate;
//! use askama::Template;
//!
//! #[derive(Template)]
//! #[template(path = "page.gmi", escape = "txt")]
//! struct Page {
//! name: String,
//! age: u8,
//! }
//!
//! async fn page() -> FluffTemplate<Page> {
//! let template = Page {
//! name: String::from("John Doe"),
//! age: 21
//! };
//!
//! FluffTemplate::from(template)
//! }
//! ```
use Template;
use ;
/// Wrapper for any type implementing askama::Template, which adds
/// fluffer::GemBytes as a trait. It can be used as a companion to
/// write gemtext templates, which can later be served using fluffer.
/// It is advised to use a "txt" escaper within the source template.