Skip to content

Latest commit

 

History

History
125 lines (84 loc) · 2.42 KB

.verb.md

File metadata and controls

125 lines (84 loc) · 2.42 KB

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

{%= description %}

Usage examples

With Handlebars:

<div>
{{#markdown}}
# Heading

> this is markdown

foo bar baz
{{/markdown}}
</div>

Results in:

<h1>Heading</h1>
<blockquote>
<p>this is markdown</p>
</blockquote>
<p>foo bar baz</p>

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

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 %}'));
var handlebars = require('handlebars');
handlebars.registerHelper('{%= nickname %}', require('{%= name %}'));
var {%= nickname %} = require('{%= name %}');

// as a mixin
_.mixin({{%= nickname %}: {%= nickname %}});
_.template('<%= _.{%= nickname %}("# heading") %>', {});
//=> '<h1>heading</h1>\n'

// passed on the context
_.template('<%= {%= nickname %}("# heading") %>', {{%= nickname %}: {%= nickname %}});
//=> '<h1>heading</h1>\n'

// as an import
var settings = {imports: {{%= nickname %}: {%= nickname %}}};
_.template('<%= {%= nickname %}("# heading") %>', {}, settings);
//=> '<h1>heading</h1>\n'

Run tests

npm test

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") %}