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

@superkoders/gulp-sk-styleguide

v1.0.5

Published

Package, which automatically generates frontend documentation.

Downloads

1

Readme

SUPERKODERS styleguide generator

Plugin for generating styleguide from static templates.

Intro Generate sidebar with links to all templates for quick and easy access.

Available icons list Keep track of projects icons with no effort.

Grid view Leverage tools for quality assurance.

Installation

Install the package in your command line

npm i -D @superkoders/gulp-sk-styleguide

Basic usage

This task takes templates as a source and generates simple styleguide. You can generate it by triggering the task manually, or extend your task for generating templates. That is recommended solution.

const gulp = require('gulp');
const skstyleguide = require('gulp-sk-styleguide');

gulp.task('styleguide', function () {
  return gulp.src('./path/to/templates/*.html')
		skstyleguide();
});

Extend task for generating templates

When templates are generated, take advantage of it and run styleguide immediatelly. Be sure to include .on('end', function() {...]}). Templates needs to be ready before we call the styleguide task.

const gulp = require('gulp');
const skstyleguide = require('gulp-sk-styleguide');

gulp.task('templates', function () {
	.pipe('...')
	.pipe(dest('...'))
	.on('end', function () {
		skstyleguide();
	});
}

Options

You can adjust behaviour of the styleguide by passiing configuration object. There are several types of settings:

Important

Public Path - path to folder with generated assets

Templates Folder - path to the templates directory relative to the public folder

Styleguide Output - path where you want output styleguide relative to the public folder

Relative path - relative path from template folder to public folder

Settings

arrowNav - navigate between pages with arrow keys. Options: true or false, default is true.

pinNav - option to keep nav always open. Options: true or false, default is true.

gridView - include grid view support - show grid overlay. Options: true or false, default is false.

debugView - include debug view support - highlight empty attributes, deprecated elements etc. Options: true or false, default is false.

theme - choose between styleguide theme. Options: light or dark or sk default is light.

iconList - automatically generate list of available icons. Options: true or false, default is false.

Additional information

Project name - you can specify project name, it will be shown in the styleguide and titles

logoPath - specify relative path to the logo image. It will be displayed in sidebar

iconsFolder - generate icon list by prociding path for folder with svg icons

User documentation

changelog - specify path to markdown changelog and it will appear as another page in the menu codeGuidelines - specify path to yaml file. The sample will be linked here. codeGuidelinesSnippetsFolder - if you want to include snippets in your guidelines, you can do so. Snippets should be in html files in folder. Specify path to given folder here, link specific snippets inside yaml. How to do that? icons - specify path to markdown documentation of icon system

Example and default values

const gulp = require('gulp');
const skstyleguide = require('gulp-sk-styleguide');

gulp.task('templates', function () {
	.pipe('...')
	.pipe(dest('...'))
	.on('end', function () {
		skstyleguide({
			projectName: 'Project name',
			templatesFolder: 'tpl/',
			styleguideOutput: 'styleguide/',
			iconsFolder: './src/img/bg/icons-svg/',
			publicPath: './web/',
			relativePath: '../',
			logoPath: 'img/logo.svg', // empty by default
			settings: {
				arrowNav: true,
				pinNav: true,
				gridView: true,
				debugView: false,
				iconList: true,
				theme: 'light',
			},
			docs: { // off by default
				changelog: './changelog.md',
				codeGuidelines: './src/docs/code-guidelines.yaml',
				codeGuidelinesSnippetsFolder: './src/docs/code-guidelines-snippets/',
				icons: './src/docs/icons.md',
			},
		});
	});
}

Usage

Open Styleguide in browser and reveal sidebar by moving cursor to left screen edge.

Author

N|Superkoders

License

This project is licensed under the MIT License - see the LICENSE.md file for details