Skip to content

waynenilsen/handlebars-markdown-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

master status

Handlebars Markdown Helper

The handlebars crate provides easy templating for any file type. This crate provides a helper for rendering a variable containing markdown into HTML within a temlpate.

Example

extern crate handlebars_markdown_helper;
use handlebars_markdown_helper;

let mut handlebars = Handlebars::new();
handlebars.register_helper("markdown", Box::new(handlebars_markdown_helper::markdown_helper));
handlebars.register_template("t0", "{{markdown x}}");

let mut m :BTreeMap<String, String> = BTreeMap::new();
m.insert("x".into(), "# wow\n\n## second wow".into());

let r0 = handlebars.render("t0", &m);
assert_eq!(r0.ok().unwrap(), "<h1>wow</h1>\n<h2>second wow</h2>\n".to_string());

deps

About

a helper for rust handlebars that provides a markdown parser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages