helpers/helper-toc

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

helper-toc NPM version

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

Install with npm

i helper-toc --save

See the tests for actual usage and options examples.

Table of contents

(Table of contents generated by [verb])

Usage
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

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'));
Related projects
Running tests

Install dev dependencies:

i -d && npm test
Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright (c) 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on May 10, 2015.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.