yeoman-handlebars-engine
v1.0.1
Published
Write yeoman generator templates in handlebars
Downloads
5
Maintainers
Readme
yeoman-handlebars-engine
Write Yeoman generator templates in Handlebars with Underscore.string helpers.
Getting Started
> npm install yeoman-handlebars-engine
Use it in your generator:
handlebarsEngine = require 'yeoman-handlebars-engine'
class RobotGenerator extends yeoman.generators.Base
engine: handlebarsEngine()
constructor: (args, options, config) ->
super
Configuration
Settings Handlebar delimiters (default to '{{' and '}}'):
handlebarsEngine = require 'yeoman-handlebars-engine'
engine = handlebarsEngine('<%=', '%>')
Helpers
Using Underscore.string helpers in your generator templates:
@myClass = 'robot generator'
@bigNumber = 123456789.123
My class: {{ classify myClass}}
Big number: {{ numberFormat bigNumber 5 "." ","}}
Outputs:
My class: RobotGenerator
Big number: 123,456,789.12300
Changelog
v1.0
Breaking change: Export a function that configures Handlebars and returns an engine, instead of exporting the engine directly.