Home

Awesome

StyleDocco

StyleDocco generates documentation and style guide documents from your stylesheets.

Stylesheet comments will be parsed through Markdown and displayed in a generated HTML document. You can write HTML code prefixed with 4 spaces or between code fences (<code>```</code>) in your comments, and StyleDocco show a preview with the styles applied, and displays the example HTML code.

The previews are rendered in a resizable iframes to make it easy to demonstrate responsive designs at different viewport sizes.

Suggestions, feature requests and bug reports are welcome either at GitHub or on Twitter (@jacobrask).

Installation

StyleDocco requires Node.js. After installing Node.js, run npm install -fg styledocco or clone this repository and run ./bin/styledocco.

StyleDocco is free and open source software, released under the MIT license.

Usage

styledocco [options] [STYLESHEET(S)]

Options

Usage examples

Generate documentation for My Project in the docs folder, from the files in the css directory.

styledocco -n "My Project" css

Generate documentation for My Project in the mydocs folder, from source files in the styles folder. Use the --compass option for SASS to make Compass imports available.

styledocco -n "My Project" -o mydocs -s mydocs --preprocessor "scss --compass" styles

Syntax

/* Provides extra visual weight and identifies the primary action in a set of buttons.

    <button class="btn primary">Primary</button> */
.btn.primary {
    background: blue;
    color: white;
}

Would display the description, a rendered button as well as the example HTML code. The CSS will be applied to the preview.

See the examples folder for more in-depth examples.

Tips and tricks

Change Log

v0.6.6 - Jan 28, 2014

v0.6.5 - Nov 17, 2013

v0.6.4 - Oct 07, 2013

v0.6.3 - July 09, 2013

v0.6.2 - June 30, 2013

v0.6.1 - August 20, 2012

v0.6.0 - August 15, 2012

v0.5.0 - July 23, 2012

Acknowledgements

A lot of the heavy lifting in StyleDocco is done by the excellent Marked module by Christopher Jeffrey. The original Docco by Jeremy Ashkenas and Knyle Style Sheets have also been sources of inspiration for StyleDocco.