Skip to content

Latest commit

 

History

History
108 lines (78 loc) · 2.36 KB

.verb.md

File metadata and controls

108 lines (78 loc) · 2.36 KB

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

{%= description %}

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

Examples

{%%= year() %}
//=> {%= year() %}
{%%= year("YYYY") %}
//=> {%= year("YYYY") %}
{%%= year("YY") %}
//=> {%= year("YY") %}

Run tests

npm test

{% var nickname = strip(name, "helper-") %}

Register the helper

This should work with any engine, here are a few examples

Register the helper for use with any template engine

template.helper('{%= nickname %}', require('{%= name %}'));

To register the helper for use with assemble v0.6.x:

assemble.helper('{%= nickname %}', require('{%= name %}'));

Register the helper for use with verb:

var verb = require('verb');
verb.helper('{%= nickname %}', require('{%= name %}'));

verb.task('default', function() {
  verb.src('.verb*.md')
    .pipe(verb.dest('./'));
});
var handlebars = require('handlebars');
handlebars.registerHelper('{%= nickname %}', require('{%= name %}'));
// as a mixin
_.mixin({{%= nickname %}: require('{%= name %}')});
_.template('<%= _.{%= nickname %}() %>', {});
//=> {%= year() %}

// passed on the context
_.template('<%= {%= nickname %}() %>', {{%= nickname %}: require('{%= name %}')});
//=> {%= year() %}

// as an import
var settings = {imports: {{%= nickname %}: require('{%= name %}')}};
_.template('<%= {%= nickname %}() %>', {}, settings);
//=> {%= year() %}

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue]({%= bugs.url %})

To request or contribute a helper to the github.com/helpers org, please read this contributing guide to get started.

Author

{%= include("author") %}

License

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


{%= include("footer") %}