# gulp-slate

> Slate API Documentation built to build with gulp

Latest version **1.0.9** (published 2016-05-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install gulp-slate
pnpm add gulp-slate
yarn add gulp-slate
bun add gulp-slate
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2016-05-13 |
| First published | 2016-02-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 15 |
| Known vulnerabilities | 0 (+4 in 2 direct dependencies) |
| Install scripts | yes |
| GitHub stars | 10 |
| Author | Michael Schramm |
| Maintainers | wodka |
| Keywords | slate, api, apidoc, markdown, md, generator, documentation, gulp, nodejs, pretty, gulpplugin |

## Links

- npm: https://www.npmjs.com/package/gulp-slate
- Repository: https://github.com/wodka/gulp-slate
- Homepage: https://github.com/wodka/gulp-slate#readme
- Issues: https://github.com/wodka/gulp-slate/issues
- npm.io page: https://npm.io/package/gulp-slate

## Dependencies (15)

- [del](https://npm.io/package/del.md) ^2.2.0
- [napa](https://npm.io/package/napa.md) ^2.3.0
- [lodash](https://npm.io/package/lodash.md) ^4.2.1
- [marked](https://npm.io/package/marked.md) ^0.3.5
- [promise](https://npm.io/package/promise.md) ^7.1.1
- [gulp-add](https://npm.io/package/gulp-add.md) 0.0.2
- [through2](https://npm.io/package/through2.md) ^2.0.0
- [gulp-sass](https://npm.io/package/gulp-sass.md) ^2.1.1
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.7
- [handlebars](https://npm.io/package/handlebars.md) ^4.0.5
- [gulp-concat](https://npm.io/package/gulp-concat.md) ^2.6.0
- [gulp-rename](https://npm.io/package/gulp-rename.md) ^1.2.2
- [gulp-uglify](https://npm.io/package/gulp-uglify.md) ^1.5.1
- [event-stream](https://npm.io/package/event-stream.md) ^3.3.2
- [highlight.js](https://npm.io/package/highlight.js.md) ^9.1.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.0.9 (latest) — 2016-05-13
- 1.0.8 — 2016-05-13
- 1.0.7 — 2016-05-13
- 1.0.6 — 2016-03-15
- 1.0.5 — 2016-03-04
- 1.0.4 — 2016-03-04
- 1.0.3 — 2016-02-09
- 1.0.2 — 2016-02-04
- 1.0.1 — 2016-02-04
- 1.0.0 — 2016-02-04
- 0.0.4 — 2016-02-04
- 0.0.3 — 2016-02-04
- 0.0.2 — 2016-02-04
- 0.0.1 — 2016-02-04

## README

# gulp-slate

node.js with port of tripit/slate to be included in gulp :)

## special features

### code blocks in main content

   ```_>javascript
   will render javascript in main content
   ```

## usage

### Instalation
```
npm install gulp-slate --save
```

### Gulp Setup

now you can setup a gulp task to handle the build
```
// inside of gulpfile.js
var gulp = require('gulp');
var slate = require('gulp-slate');

gulp.task('slate', function () {
    return gulp.src(
        [
            'node_modules/gulp-slate/node_modules/slate/source/index.html.md'
        ]
    )
        .pipe(slate())
        .pipe(gulp.dest('dist/'))
    ;
});
```

### First Build

this is really simple since the task is already setup:

```
gulp slate
```

now go on and host the dist/ folder somewhere

### simple webserver
```
python -m SimpleHTTPServer 8000
```

now open http://localhost:8000 in a browser of your choice, result should look exactly like http://tripit.github.io/slate/

### Neat Features

If you need different Language groups use an Alias: angular>javascript for javascript highlighting in the angular group

## automate development

you can use browserSync

I will now asume that your repository looks like this:

    .
    ├── dist
    ├── docs
    │   ├── custom.scss
    │   └── index.html.md
    ├── gulpfile.js
    └── package.json

### installation

```
npm install browser-sync --save
```

### gulpfile.js
```
var gulp = require('gulp');
var slate = require('gulp-slate');
var browserSync = require('browser-sync').create();

gulp.task('slate', function () {
    return gulp.src('docs/index.html.md')
        .pipe(slate({
            scss: 'docs/custom.scss'
        }))
        .pipe(gulp.dest('dist/'))
        .on('end', browserSync.reload)
    ;
});

gulp.task('serve', ['slate'], function() {

    browserSync.init({
        port: 8080,
        server: {
            baseDir: "./dist"
        }
    });

    gulp.watch('docs/**', ['slate']);
});

```

### run it :)

this will start browserSync, watch for changes inside of docs and refresh your browser!

```
gulp serve
```

## configuration

### constructor(options)
#### options.assets
add assets to current stream

Type: `Boolean`<br><br>Default `true`

#### options.filename
set the filename - warning: only use one input file! else only the last one will show up

Type: `String`<br><br>Default `index.html.md` will become `index.html`

#### options.log
log level: DEBUG|INFO|WARN|ERROR

Type: `String`<br><br>Default `WARN`

#### options.style
Highlighting style, use any name from https://github.com/isagalaev/highlight.js/tree/master/src/styles

Type: `String`<br><br>Default `solarized-dark`

#### options.template
Template to render - in general you should never need to touch this

Type: `String`<br><br>Default `src/layout.html`

#### options.scss
If you need to override certain css parameters, do not forget to include the original app.scss if you change this

Type: `String`<br><br>Default `src/app.scss`

#### options.variables
load your own variables, default variables from slate are always loaded first

Type: `String`<br><br>Default `null`

#### options.logo
to have a custom logo added to the page

Type: `String`<br><br>Default `node_modules/slate/source/images/logo.png`

#### options.includeLoader
where to load includes from, the function receives the name as well as the
path to the main markdown file and should return a promise that resolves the file content

Type: `Function`<br><br>Default `error` will be loaded from `includes/_error.md`

## thanks to
* https://github.com/jmanek/slate_node
* https://github.com/tripit/slate

---
_Source: https://npm.io/package/gulp-slate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
