SassDocs
// Install Global
npm install sassdoc -g
// Install Local
npm install sassdoc --save-dev
// Gulp Setup
gulp.task('sassdoc', function () {
var options = {
dest: 'docs',
verbose: true,
display: {
access: ['public', 'private'],
alias: true,
watermark: true,
},
groups: {
'undefined': 'Ungrouped',
foo: 'Foo group',
bar: 'Bar group',
},
basePath: 'https://github.com/SassDoc/sassdoc',
};
return gulp.src('src/styles/**/*.scss')
.pipe(sassdoc(options));
});
// Example is sass file
/// Helper mixin to size elements in a single line.
/// This mixin is essentially a short hand to define
/// both `width` and `height` simultaneously.
///
/// @group shorthand
/// @author Hugo Giraudel
///
/// @param {Length} $width - Element's width
/// @param {Length} $height [$width] - Element's height
/// @output `width` and `height`
///
/// @example scss - Sizing `.foo`
/// .foo {
/// @include size(100%, 3em);
/// }
@mixin size($width, $height: $width) {
width: $width;
height: $height;
}