cortex-handlebars-compiler
Handlebar helpers for cortex template.
Install
$ npm install cortex-handlebars-compiler --save
Usage
var compiler = require('cortex-handlebars-compiler');
compiler(options)
Returns the compiler.Compiler
instance.
Class: compiler.Compiler(options)
- options
Object
- pkg
Object
object of cortex.json - root
path
the root directories of packages - shrinkWrap
Object
object of cortex-shrinkwrap.json - ext
String='.js'
the extension of module files, default to '.js'
.compile(template)
- template
String
template string
Parses the template string and returns the parsed function.
.register(helper, handler)
- helper
String
the name of the helper - handler
function(title, helper_options)
see handlebars for details
Registers a new helper handler.
Returns this
.
Built-in helpers
{{{facade '<package-name>'}}}
The first 'facade' will also output the engines and configurations.
License
MIT