0.1.4 • Published 9 years ago

boo-templates v0.1.4

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

:ghost: boo-templates

a very lightweight (and spoooooky) templating tool (that is also your boo :heart:)

a Template

var template = new BooTemplate("This is {{foo}}ey.");
template.compile({foo: "barn"});
// => "This is barney."
var template = new BooTemplate("This is <%foo%>ey.", "<%", "%>");
template.compile({foo: "barkl"});
// => "This is barkley."

a Compiler(open, close)

the Compiler is what powers a template. It implements a global search on a given template string and evalutes anything between open and close delimiters.

open and close default to "{{" and "}}"

var compiler = new BooTemplate.Compiler();
compiler.compile("{{foo}}{{bar}}", {foo: "Boo", bar: "Template"});
// => "BooTemplate"
var compiler = new BooTemplate.Compiler("<%", "%>");
compiler.compile("<%foo%> <%bar%>", {foo: "Your", bar: "Boo"});
// => "Your Boo"
0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.0

9 years ago