Brio
Templated layout builders.
npm install brio
Usage
(Pretending that Javascript has multiline strings)
var brio = handlebars = ; var pages = ; ; /*⇒ <!doctype html> <html> <head> <title>Home</title> </head> <body> <h1>Home</h1> <main> Welcome! </main> </body> </html>*/
API
brio :: (Template → Params → String) → Tree String Template → Path → Params → String
Takes a templater, a tree of templates, a path to a template, some params and spits out a compiled string.
Templaters
Are any curried function taking a template and some parameters and returning a string. Handlebars fits nicely, as does _.template
.
Licence
MIT. © 2014 Matt Brennan.