Awesome Open Source
Awesome Open Source

Slate helps you create beautiful, intelligent, responsive API documentation.


node-slate as a gulp task

npm   dependencies Status   Known Vulnerabilities   Build Status

A) Lightning quick demo

Don't have an existing gulp project? Just want to experiment with no commitment?

Blindly enter these commands:

$ mkdir my-api-docs
$ cd my-api-docs
$ npm init --yes
$ npm install [email protected] --save-dev
$ npm install gulp-node-slate --save-dev
$ cat > gulpfile.js << EOF
const gulp =  require('gulp');
const slate = require('gulp-node-slate');
function generateApiDocs() { return gulp.src('.').pipe(slate()); }
gulp.task('slate', generateApiDocs);
$ node node_modules/gulp/bin/gulp.js slate
$ open build/index.html

Otherwise, follow the steps below.

B) Instructions

1. Install into your project:

$ npm install gulp-node-slate --save-dev

2. Add a task to your gulpfile.js:

const slate = require('gulp-node-slate');
function generateApiDocs() { return gulp.src([]).pipe(slate()); }
gulp.task('slate', generateApiDocs);

3. Build and view the API documentation:

$ gulp slate
$ ls source
$ open build/index.html

The structure of the generated source folder is:


4. Get to work

Customize the files in the source folder to create your API documentation and then rerun gulp slate.

C) Configuration

Example of passing in options:

.pipe(slate({ source: 'api-docs/input', build: 'api-docs/output' }))


  • source – Relative path to the Slate API documentation input folder (default: 'source').
  • build – Relative path to the Slate API documentation output folder (default: 'build').

E) Notes

  1. If you want to contribute to the project, fork it and then run the script and examine the contents of the api-docs folder. Pull requests are welcome.
  2. If you have a question, suggestion, or bug to report, open an issue.

MIT License

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Javascript (1,508,638
Nodejs (53,643
Gulp (2,644
Static Site Generator (1,554
Api Documentation (367
Related Projects