Skip to content

Latest commit

 

History

History
58 lines (38 loc) · 1.1 KB

.verb.md

File metadata and controls

58 lines (38 loc) · 1.1 KB

{%= name %} {%= badge("fury") %} {%= badge("travis") %}

{%= description %}

{%= include("install-npm", {save: true}) %}

Usage

var helper = require('{%= name %}');

Handlebars example

var handlebars = require('handlebars');

// 1. pass your instance of handlebars
var helper = require('{%= name %}')(handlebars);

// 2. register the helper, name it whatever you want
handlebars.registerHelper('partial', helper);

// 3. register some partials
handlebars.registerPartial('button', '<button>{{text}}</button>');

// 4. use in templates
handlebars.compile('{{partial "button"}}')({text: 'Click me!'});
//=> '<button>Click me!</button>'

Pass a specific context to the partial:

handlebars.compile('{{partial "button" a.b.c}}')({a: {b: c: {text: 'Click me!'}}});
//=> '<button>Click me!</button>'

Related projects

{%= related(['handlebars-helpers', 'template-helpers']) %}

Running tests

{%= include("tests") %}

Contributing

{%= include("contributing") %}

Author

{%= include("author") %}

License

{%= copyright() %} {%= license() %}


{%= include("footer") %}