generator-verb
Version:
Kickstart documentation for any project! This is the official Yeoman generator for Verb, the zero-configuration markdown docs generator that is extremely easy to use and extend.
122 lines (82 loc) • 2.62 kB
Markdown
> {%= description %}
{%= include("install-npm", {save: true}) %}
With Handlebars:
```handlebars
{{{%= nickname %} ""}}
```
With Lo-Dash or Underscore:
```js
<%= {%= nickname %}("") %>
```
With Verb (lo-dash, with special delimiters to avoid delimiter collision in markdown docs):
```js
{%= "{%%= " + nickname + "('') %}" %}
```
> This should work with any engine, here are a few examples
Register the helper for use with any template engine
```js
template.helper('{%= nickname %}', require('{%= name %}'));
```
To register the helper for use with [assemble] v0.6.x:
```js
assemble.helper('{%= nickname %}', require('{%= name %}'));
```
Register the helper for use with [verb]:
```js
var verb = require('verb');
verb.helper('{%= nickname %}', require('{%= name %}'));
verb.task('default', function() {
verb.src('.verb*.md')
.pipe(verb.dest('./'));
});
```
```js
var handlebars = require('handlebars');
handlebars.registerHelper('{%= nickname %}', require('{%= name %}'));
```
```js
// as a mixin
_.mixin({{%= nickname %}: {%= nickname %}Helper});
_.template('<%= _.{%= nickname %}("fixtures/*.txt") %>', {});
//=> 'AAA\nBBB\nCCC'
// passed on the context
_.template('<%= {%= nickname %}("fixtures/*.txt") %>', {{%= nickname %}: {%= nickname %}Helper});
//=> 'AAA\nBBB\nCCC'
// as an import
var settings = {imports: {{%= nickname %}: {%= nickname %}Helper}};
_.template('<%= {%= nickname %}("fixtures/*.txt") %>', {}, settings);
//=> 'AAA\nBBB\nCCC'
```
Install dev dependencies:
```bash
npm install -d && mocha
```
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][helpers] org, please read [this contributing guide][guide] to get started.
{%= include("author") %}
{%= copyright() %}
{%= license() %}
***
{%= include("footer") %}
[]: https://github.com/assemble/assemble
[]: https://github.com/assemble/generator-verb
[]: https://github.com/assemble/handlebars-helpers/
[]: https://github.com/wycats/handlebars.js/
[]: https://github.com/helpers
[]: https://lodash.com/
[]: https://github.com/jonschlinkert/template
[]: https://github.com/jashkenas/underscore
[]: https://github.com/assemble/verb
[]: https://github.com/helpers/requests