extern crate env_logger; extern crate handbar; use handbar::Handbar; use serde_json::json; use std::error::Error; fn main() -> Result<(), Box> { env_logger::init(); let mut handbar = Handbar::new(); handbar.register_template_file("template", "./examples/partials/template2.hbs")?; handbar.register_template_file("base0", "./examples/partials/base0.hbs")?; handbar.register_template_file("base1", "./examples/partials/base1.hbs")?; let data0 = json!({ "title": "example 0", "parent": "base0" }); let data1 = json!({ "title": "example 1", "parent": "base1" }); println!("Page 0"); println!("{}", handbar.render("template", &data0)?); println!("======================================================="); println!("Page 1"); println!("{}", handbar.render("template", &data1)?); Ok(()) }