Skip to content

hurrymaplelad/yeoman-handlebars-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yeoman-handlebars-engine

Deprecated

Write Yeoman generator templates in Handlebars with Underscore.string helpers.

NPM version Build Status

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.

About

Write yeoman generator templates in handlebars

Resources

Stars

Watchers

Forks

Packages

No packages published