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
//! # Tour Template
//!
//! Tour Template is a compile-time templating library with support for runtime reload.
//!
//! # Runtime Reload
//!
//! Given type with [`Template`] derive macro:
//!
//! ```ignore
//! // main.rs
//! use tour::Template;
//!
//! #[derive(Template)]
//! #[template(path = "index.html")]
//! struct Tasks {
//! tasks: Vec<String>,
//! }
//!
//! let result = Tasks { tasks: vec![] }.render().unwrap();
//! println!("{result}");
//! ```
//!
//! Templates are searched from `templates` directory from project root by default, so above
//! example will search for `templates/index.html`.
//!
//! ```html
//! <!-- templates/index.html -->
//! {{ for task in tasks }}
//! Task: {{ task.get(1..6) }}
//! {{ else }}
//! No Tasks
//! {{ endfor }}
//! ```
//!
//! In debug mode, changing non expression like `No Tasks` in the source file, will
//! change the output with the new content on the next render without recompiling.
//!
//! Note that changing expression like `{{ for task in tasks }}` still requires recompile. An
//! attempt to render it without recompile, will change nothing and may result in error.
//!
//! This is still better than require to recompile on every small changes. In practice, quick
//! changes iteration is used for style changes.
//!
//! [`Template`]: tour_macros::Template
pub use Template;
pub use ;
pub use ;
pub use ;
pub use ;
pub use Template;