Giter Club home page Giter Club logo

styledocco's Introduction

 _______ __         __        _____
|     __|  |_.--.--|  |-----.|     \-----.----.----.-----.
|__     |   _|  |  |  |  -__||  --  | _  |  __|  __|  _  |
|_______|____|___  |__|_____||_____/_____|____|____|_____|
             |_____|

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 code examples inside GitHub Markdown code fences (```) or prefixed with 4 spaces in your comments, and StyleDocco both renders the HTML and shows the code example.

The document is automatically split into new sections when it encounters a level 1 or 2 heading. Read more about the heading syntax in the Markdown guide. Only comments at the beginning of new lines are included, so to exclude something from the style guide, put some whitespace before the comment.

If your project includes a README file, it will be used as the base for an index.html. StyleDocco will also add some default styles to your documentation, but they are easy to modify to make it fit with your project.

StyleDocco will automatically compile any SASS, SCSS, Less or Stylus code before it is applied to the page.

Installation

StyleDocco requires Node.js.

npm install -g styledocco

or check out this repository.

StyleDocco is free software, released under the MIT license.

Usage

styledocco [options] [INPUT]

Options

  • --name, -n Name of the project (required)
  • --out, -o Output directory (default: "docs")
  • --tmpl Directory for custom docs.jade template (optional)
  • --overwrite Overwrite existing files (docs.css) in target directory.

Examples

/*
    <button class="btn primary">Primary</button>

Provides extra visual weight and identifies the primary action in a set of buttons. */
.btn.primary {
    background: blue;
    color: white;
}

Would display the description, a button as well as the example HTML code. The CSS will be included in the style element of the document.

See the examples folder for more in-depth examples.

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 Docco Husky by Mike Brevoort were also of great help to this project.

styledocco's People

Contributors

jacobrask avatar jashkenas avatar mbrevoort avatar andrewschaaf avatar strathmeyer avatar nevir avatar g3z avatar pascalopitz avatar thejefflarson avatar raoulmillais avatar tswicegood avatar isaacs avatar mathieuravaux avatar

Stargazers

JC avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.