$ npm install helper-codelinksGenerate a list of links that take you to the first line of code for each method in a given directory.
npm i helper-codelinks --save
Add a verbfile.js to your project with the following:
var verb = require('verb');
// register the helper
verb.helper('codelinks', require('helper-codelinks'));
// add a task to build your docs
verb.task('default', function () {
return verb.src('my-documentation.md')
.pipe(verb.dest('docs/'));
});
In your .verb.md file:
{%= codelinks('lib/', {filter: '!**/foo.js'}) %}
Results in markdown like this:
+ **[one](fixtures/one.js)**
- [.a](fixtures/one.js#L7)
- [.b](fixtures/one.js#L13)
- [.c](fixtures/one.js#L19)
+ **[two](fixtures/two.js)**
- [.c](fixtures/two.js#L7)
- [.d](fixtures/two.js#L13)
- [.e](fixtures/two.js#L19)
_(Code links generated by [verb] using the [api-toc] helper)_
Which renders to a list of links that looks like this:
(Code links generated by verb using the api-toc helper)
See the example verbfile.js.
Install dev dependencies:
npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright (c) 2015 Jon Schlinkert
Released under the MIT license
This file was generated by verb-cli on April 19, 2015.