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
extern crate serde_derive;

#[macro_use]
extern crate serde_json;

mod metadata;
mod renderer;

pub mod config;
pub mod fs;
pub mod highlighter;
pub mod loader;
pub mod registry;
pub mod writer;

#[macro_export]
/// A macro loads handlebar files in default template with include_str! macro.
macro_rules! include_template_file(
    { $( $x:expr ),* } => {
        {
            let mut t = Vec::new();
            $(
                // TODO: is it any way can omit this slash?
                t.push(($x, include_str!(concat!("theme/", $x, ".hbs"))));
            )*
            t
        }
    };
);

#[macro_export]
/// A macro loads static files in default template with include_str! macro.
macro_rules! include_static_file(
    { $( $x:expr ),* } => {
        {
            let mut s = Vec::new();
            $(
                // TODO: is it any way can omit these slashes?
                s.push((
                    $x,
                    include_str!(concat!("theme/static/", $x)),
                ));
            )*
            s
        }
    };
);