StyleDocco generates documentation and style guide documents from your stylesheets.
Stylesheet comments will be parsed throughMarkdown and displayed in a generated HTML document. You can write HTML code prefixed with 4 spaces or betweencode fences (```) in your comments, and StyleDocco shows a preview with the styles applied, and displays the example HTML code.
The previews are rendered in resizable iframes to make it easy to demonstrate responsive designs at different viewport sizes.
Suggestions, feature requests and bug reports are very welcome, either atGitHub or on Twitter (@jacobrask).
StyleDocco requiresNode.js. After installing Node.js, runnpm install -fg styledocco or clone this repository.
StyleDocco is free software, released under theMIT license.
The following is the code you would write in your stylesheet, and theOutput is what you would see in the documentation.
/* Provides extra visual weight and identifies the primary action in a set of buttons. <button>Primary</button>*/.btn.primary { background: steelblue; color: snow; border: 2px outset steelblue;}Provides extra visual weight and identifies the primary action in a set of buttons.
For more in-depth examples, thedocs file is the documentation of the default StyleDocco CSS file, and anadditional example was generated from a modified file of the Twitter Bootstrap project.
styledocco [options] [INPUT]
--name,-n Name of the project(required)--out,-o Output directory(default: "docs")--preprocessor Custom preprocessor command.(optional) (ex:--preprocessor "scss --load-path=deps/")--include Include specified CSS and/or JavaScript files in the previews.(optional) (ex:--include mysite.css --include app.js)--verbose Show log messages when generating the documentation.(default: false)--no-minify Do not minify the code.(default: false)Generate documentation forMy Project in thedocs folder, from the files in thecss directory.
styledocco -n "My Project" css
Generate documentation forMy Project in themydocs folder, from source files in thestyles folder. Use the Less binary in~/bin/lessc.
styledocco -n "My Project" -o mydocs -s mydocs --preprocessor "~/bin/lessc" styles
:hover,:focus, etc as class names in example code and the pseudo class styles will be applied in the previewA lot of the heavy lifting in StyleDocco is done by the excellentMarked module by Christopher Jeffrey. The originalDocco by Jeremy Ashkenas andKnyle Style Sheets have also been sources of inspiration for StyleDocco.
January 28, 2014
November 17, 2013
October 07, 2013
July 09, 2013
June 30, 2013
August 20, 2012
August 15, 2012
July 23, 2012