2021-03-02 04:17:16 +00:00
|
|
|
fn main() {
|
2021-03-03 02:38:15 +00:00
|
|
|
#[cfg(feature = "mdbook-renderer")]
|
|
|
|
include_mdbook_templates();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(feature = "mdbook-renderer")]
|
|
|
|
fn include_mdbook_templates() {
|
|
|
|
use glob::glob;
|
|
|
|
use includedir_codegen::Compression;
|
|
|
|
|
2021-03-02 04:17:16 +00:00
|
|
|
let mut templates = includedir_codegen::start("BASE_TEMPLATES");
|
|
|
|
|
|
|
|
for path_result in glob("book/**/*.tera").unwrap() {
|
|
|
|
let path = path_result.unwrap();
|
|
|
|
templates.add_file(path, Compression::Gzip).unwrap();
|
|
|
|
}
|
|
|
|
|
|
|
|
templates.build("mdbook-templates.rs").unwrap();
|
|
|
|
}
|