Grunt Tocgen
Grunt enhanced table of contents generator.
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 */