Grunt enhanced table of contents generator


Keywords
docblock, tocgen, gruntplugin, css, table-of-contents
License
MIT
Install
npm install grunt-tocgen@1.3.1

Documentation

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:
			{
				tags:
				{
					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 */