npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-slate

v1.0.9

Published

Slate API Documentation built to build with gulp

Downloads

44

Readme

gulp-slate

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

special features

code blocks in main content

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: BooleanDefault true

options.filename

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

Type: StringDefault index.html.md will become index.html

options.log

log level: DEBUG|INFO|WARN|ERROR

Type: StringDefault WARN

options.style

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

Type: StringDefault solarized-dark

options.template

Template to render - in general you should never need to touch this

Type: StringDefault 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: StringDefault src/app.scss

options.variables

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

Type: StringDefault null

options.logo

to have a custom logo added to the page

Type: StringDefault 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: FunctionDefault error will be loaded from includes/_error.md

thanks to

  • https://github.com/jmanek/slate_node
  • https://github.com/tripit/slate