diff options
Diffstat (limited to 'vendor/handlebars/src/lib.rs')
-rw-r--r-- | vendor/handlebars/src/lib.rs | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/vendor/handlebars/src/lib.rs b/vendor/handlebars/src/lib.rs index 7e0aac830..1f9ab1ed3 100644 --- a/vendor/handlebars/src/lib.rs +++ b/vendor/handlebars/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/handlebars/4.1.0")] +#![doc(html_root_url = "https://docs.rs/handlebars/4.3.3")] #![cfg_attr(docsrs, feature(doc_cfg))] //! # Handlebars //! @@ -73,7 +73,7 @@ //! Every time I look into a templating system, I will investigate its //! support for [template inheritance][t]. //! -//! [t]: https://docs.djangoproject.com/en/1.9/ref/templates/language/#template-inheritance +//! [t]: https://docs.djangoproject.com/en/3.2/ref/templates/language/#template-inheritance //! //! Template include is not sufficient for template reuse. In most cases //! you will need a skeleton of page as parent (header, footer, etc.), and @@ -155,7 +155,7 @@ //! use handlebars::Handlebars; //! use std::collections::BTreeMap; //! -//! # fn main() -> Result<(), Box<Error>> { +//! # fn main() -> Result<(), Box<dyn Error>> { //! let mut handlebars = Handlebars::new(); //! let source = "hello {{world}}"; //! @@ -166,6 +166,14 @@ //! # } //! ``` //! +//! #### Additional features for loading template from +//! +//! * Feature `dir_source` enables template loading +//! `register_templates_directory` from given directory. +//! * Feature `rust-embed` enables template loading +//! `register_embed_templates` from embedded resources in rust struct +//! generated with `RustEmbed`. +//! //! ### Rendering Something //! //! Since handlebars is originally based on JavaScript type system. It supports dynamic features like duck-typing, truthy/falsey values. But for a static language like Rust, this is a little difficult. As a solution, we are using the `serde_json::value::Value` internally for data rendering. @@ -188,7 +196,7 @@ //! age: i16, //! } //! -//! # fn main() -> Result<(), Box<Error>> { +//! # fn main() -> Result<(), Box<dyn Error>> { //! let source = "Hello, {{name}}"; //! //! let mut handlebars = Handlebars::new(); @@ -367,13 +375,8 @@ #[macro_use] extern crate log; -#[cfg(test)] -#[macro_use] -extern crate maplit; #[macro_use] extern crate pest_derive; -#[macro_use] -extern crate quick_error; #[cfg(test)] #[macro_use] extern crate serde_derive; |