Skip to content

joemonmathews/sassdoc

 
 

Repository files navigation

SassDoc NPM version Build Status

Like JSDoc for your Sass files.

SassDoc

Installation

npm

npm install -g sassdoc

Grunt

See grunt-sassdoc.

Gulp

See gulp-sassdoc.

Usage

Command line

sassdoc <src> <dest> [options]

Arguments:

  1. <src> Path to your Sass folder.
  2. <dest> Path to the destination folder.

Options:

  • -h, --help: Bring help.
  • --version: Show version.
  • -v, --verbose: Run in verbose mode.
  • -c, --config: Path to JSON file containing variables to be passed to the view.
  • --no-update-notifier: Do not run the update notifier check.

Node

Install

npm install sassdoc --save

Use The Raw Data

var sassdoc = require('sassdoc');

sassdoc.parse(__dirname + '/sass').then(function (items) {
  console.log(items);
})

Generate Documentation

var config = {
  "display": {
    "access": ["public", "private"],
    "alias": false,
    "watermark": true
  },

  "package": "./package.json"
}

var sassdoc = require('sassdoc');
sassdoc.documentize(source, dest, config);

Documentating your items

See Wiki.

Customising the view

See Wiki.

Example

/**
 * Adds `$value` at `$index` in `$list`.
 *
 * @author Hugo Giraudel
 *
 * @ignore Documentation: http://sassylists.com/documentation/#insert-nth
 *
 * @requires is-true
 *
 * @param {List}   $list  - list to update
 * @param {Number} $index - index to add
 * @param {*}      $value - value to add
 *
 * @throws List index $index is not a number for `insert-nth`.
 * @throws List index $index must be a non-zero integer for `insert-nth`.
 *
 * @return {List | Null}
 */

@function insert-nth($list, $index, $value) {
  // ...
}

/**
 * Defines whether the lib should support legacy browsers (e.g. `IE 8`).
 *
 * @since 1.3.37
 *
 * @todo Nothing. It's awesome.
 *
 * @link https://github.com/SassDoc/sassdoc SassDoc
 *
 * @type Bool
 */
$legacy-support: true !global;

Built with SassDoc

Credits

About

Like JSDoc, but for Sass files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published