Gulp plugin for StyleDocco and supports incremental building.
SytleDocco is a great documentation tool for CSS/Less/Sass and so on. And now, this tool does not support incremental building. Because generated documents have navigations to each others. So we can not generate documents incrementally.
But we can generate documents individually, and then we can do incremental building.
For example:
-
StyleDocco (not individual):
path/to/file.css
->path/to/docs/file.html
path/to/sub/file.css
->path/to/docs/sub-file.html
- These documents include navigations for each others.
-
StyleDocco (individual):
path/to/file.css
->path/to/docs/file.css/file.html
path/to/sub/file.css
->path/to/docs/sub/file.css/file.html
- These documents do NOT include navigations for each others.
var gulp = require('gulp');
var styledocco = require('gulp-styledocco-individual').styledoccoIndividual;
gulp.task('docs', () => {
return gulp.src('css/**/*.css')
.pipe(styledocco({ out: 'docs' }));
});
And this plugin pass through got files when processing is done. So, you can write:
var gulp = require('gulp');
var styledocco = require('gulp-styledocco-individual').styledoccoIndividual;
var autoprefixer = require('gulp-autoprefixer');
gulp.task('docs', () => {
return gulp.src('css/**/*.css')
.pipe(styledocco({ out: 'docs' }))
.pipe(autoprefixer())
.pipe(gulp.dest('built'));
});
See Using ES6 with gulp.
import gulp from 'gulp';
import {styledoccoIndividual} from 'gulp-styledocco-individual';
gulp.task('docs', () => {
return gulp.src('css/**/*.css')
.pipe(styledoccoIndividual({ out: 'docs' }));
});
$ npm install --save-dev gulp-styledocco-individual
Option Name | Type | Optional | Default |
---|---|---|---|
out |
string |
yes | 'docs' |
name |
string |
yes | name property of package.json or '' |
includes |
string[] |
yes | None |
verbose |
boolean |
yes | false |
noMinify |
boolean |
yes | false |
preprocessor |
string |
yes | None |
styledocco |
string |
yes | ./node_modules/.bin/styledocco |
An output directory. It can be a relative path from the cwd.
A name of the generated document. It will be used as the document page title.
Included files for the preview in the generated documentation. It can be a relative path from the cwd.
Show log messages when generating the documentation.
Disable minificating CSS/JavaScript in the generated documentation.
A file path for the CSS preprocessor such as '~/bin/lessc'
.
It can be a relative path from the cwd.
A file path for the StyleDocco command such as '~/bin/styledocco'
.
It can be a relative path from the cwd.
Returns a file path to the doc. This function is useful for incremental building.
Type: string
File path to document.
Type: string
Base path of the filePath. Typically, it should be vinyl.base.
Type: { out: string | undefined | null }
or undefined
or null
Options for gulp-styledocco-individual.
Type: string
File path to the doc.
MIT