HTML Outliner for Gulp - generates a Table of Contents
npm install gulp-outlinerA Gulp plugin for creating a document-outline (table of contents) based on a structured HTML document arriving as a stream, it injects the outline into the stream (at a predetermined point), and passes the stream on for the next plugin to work on.
```
npm install gulp-outliner --save-dev
In your HTML create a placeholder for the outline. The outline is appended to the content of an element whose id is contents. For example:
`html`
Contents
In your gulp file add
`js
var gulp = require('gulp');
var gulp_outliner = require('gulp-outliner');
// example task
gulp.task('outline',
function () {
return gulp.src("./test/input/*.html")
.pipe(gulp_outliner()) // add toc
.pipe(gulp.dest('./test/output/'));
}
);
`gulp outline` from the command line.
Then run