[][src]Crate guidon

guidon

guidon performs templating based on handlebars templating system.

Usage

Files to be handles needs to have an .hbs extension. Folders can be templatized too : {{folder/subfolder}} The entry point is the Guidon structure.

use guidon::Guidon;

 let mut guidon = Guidon::with_conf("path/to/template.toml").unwrap();
 guidon.apply_template("path/to/template/dir", "path/to/destination").unwrap();

Configuration

The configuration file is structured as follows :

# Optional
# By default will pick the template to apply in a folder named template in the provided folder
use_template_dir = true
# Optional
# By default any missing substitution key will raise an error.
# If false, it will silently initialize the value withe an empty string.
use_strict_mode = true

# Key value pairs for template substitution
# Each occurrence of
[variables]
test1 = "test 1"
test2 = "test 2"

Logs

guidon uses the log facade.

Callbacks

TODO

Modules

errors

Structs

Guidon

The Guidon structure

Type Definitions

RenderCallback
VariablesCallback