Name: helper-toc
Owner: Helpers
Description: Template helper for generating a table of contents using content from the file in which the helper is used, or for a glob of files.
Created: 2015-05-02 04:37:55.0
Updated: 2015-05-20 18:25:52.0
Pushed: 2015-05-10 14:55:06.0
Homepage: null
Size: 136
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Template helper for generating a table of contents using content from the file in which the helper is used, or for a glob of files.
Install with npm
i helper-toc --save
See the tests for actual usage and options examples.
(Table of contents generated by [verb])
toc = require('helper-toc');
Example using Lo-Dash templates:
toc("*.md") %>
Render:
ass a string, and pass the helper on the context
result = _.template(str)({toc: helper()});
Results in a table of contents that looks something like:
ne.md](./one.md)
wo.md](./two.md)
hree.md](./one.md)
Register with [template]
Template = require('template');
template = new Template();
late.helper('toc', require('helper-toc'));
Register with [verb]
verb = require('verb');
.helper('toc', require('helper-toc'));
Register with [assemble]
assemble = require('assemble');
mble.helper('toc', require('helper-toc'));
Install dev dependencies:
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 May 10, 2015.