gulp-node-slate

node-slate as a gulp task

Usage no npm install needed!

<script type="module">
  import gulpNodeSlate from 'https://cdn.skypack.dev/gulp-node-slate';
</script>

README

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

gulp-node-slate

node-slate as a gulp task

License:MIT npm Vulnerabilities Build

A) Lightning Quick Demo

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

Blindly enter these 9 commands in your terminal:

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

B) Instructions

1. Install into your project:

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

2. Add a task to your gulpfile.js:

// Imports
import gulp from 'gulp';
import slate from 'gulp-node-slate';

// Tasks
const generateApiDocs = () => gulp.src([]).pipe(slate());

// Gulp
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:

source/
   images/
      logo.png
   includes/
      *.md
   custom.scss
   index.yml

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

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').

E) Notes

  1. If you want to contribute to the project, fork it and then run the spec-runner.sh.command 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