๐ซย Gulp is no longer maintained. The same functionality of this gulp plugin is available as a regular CLI build task without gulp. See: node-slate |
---|
Slate helps you create beautiful, intelligent, responsive API documentation.
node-slate as a gulp task
Don't have an existing gulp project? Just want to experiment with no commitment?
$ mkdir my-api-docs
$ cd my-api-docs
$ npm init --yes
$ npm install --save-dev gulp gulp-node-slate
$ f=https://raw.githubusercontent.com/center-key/gulp-node-slate/main/gulpfile.js
$ curl --remote-name $f
$ cat gulpfile.js
$ node node_modules/gulp/bin/gulp.js slate
$ open build/index.html
Otherwise, follow the steps below.
$ npm install --save-dev gulp gulp-node-slate
// Imports
import gulp from 'gulp';
import slate from 'gulp-node-slate';
// Tasks
const generateApiDocs = () => gulp.src([]).pipe(slate());
// Gulp
gulp.task('slate', generateApiDocs);
$ gulp slate
$ ls source
$ open build/index.html
The structure of the generated source
folder is:
source/
images/
logo.png
includes/
*.md
custom.scss
index.yml
Customize the files in the source
folder to create your API documentation
and then rerun gulp slate
.
Example of passing in options:
.pipe(slate({ source: 'api-docs/input', build: 'api-docs/output' }))
Options:
source
โ Relative path to the Slate API documentation input folder (default:'source'
).build
โ Relative path to the Slate API documentation output folder (default:'build'
).
- You can also generate your Slate API documentation without Gulp by using node-slate directly (the direct approach is recommended over using this Gulp plugin).
- If you want to contribute to the project, fork it and then run the
spec-runner.sh.command
script and examine the contents of theapi-docs
folder. Pull requests are welcome. - If you have a question, suggestion, or bug to report, open an issue.