Grunt enhanced table of contents generator
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tasks
tests
.eslintrc
.gitignore
.travis.yml
README.md
gruntfile.js
index.js
option.json
package.json

README.md

Grunt Tocgen

Grunt enhanced table of contents generator.

Build Status NPM Version Licensen

Installation

npm install grunt-tocgen

Usage

Load the task:

grunt.loadNpmTasks('grunt-tocgen');

Config the task:

grunt.initConfig(
{
	tocgen:
	{
		name:
		{
			src:
			[
				'styles/*.css'
			],
			options:
			{
				tag:
				{
					toc: 'tableofcontents',
					section: 'section'
				},
				indent: ' ',
				newline: '\n'
			}
		}
	}
}

Run the task:

grunt tocgen

Examples

Input file:

/** @section 1. first */

/** @section 1.1 sub */

/** @section 2. second */

Output file:

/**
 * @tableofcontents
 *
 * 1. first
 *    1.1 sub
 * 2. second
 */

/** @section 1. first */

/** @section 1.1 sub */

/** @section 2. second */