gulp-outliner

0.0.8 • Public • Published

gulp-outliner

A 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.

Install

npm install gulp-outliner --save-dev

Example

Using gulp-outliner

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:

<div id="contents">
    <h1>Contents</h1>
</div>

In your gulp file add

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/'));
    }
);

Then run gulp outline from the command line.

Development

Testing

To do

See the issues page.

Package Sidebar

Install

npm i gulp-outliner

Weekly Downloads

11

Version

0.0.8

License

none

Last publish

Collaborators

  • ear1grey