Introduction
If you haven’t used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use grunt plugins. Once you’re familiar with that process, install this plugin with this command:
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
Tip: the load-grunt-tasks module makes it easier to load multiple grunt tasks.
Run the task:
Task targets, files and options may be specified according to the Grunt Configuring tasks guide.
Options
Any specified option will be passed through directly to SassDoc, thus you can specify any option that SassDoc supports. Refer to:
- Getting started for CLI options;
- Configuration for SassDoc options;
- Customising the view for default theme options.
Heads up: if options or a config file are passed it will prevail
over .sassdocrc
if any. You should really manage your options in one place.
Examples
See the Gruntfile in the repository for full examples.
Bare minimum example.
Example with an external configuration file.
Example with some options passed in.
Events
This task will emit a start
event when compilation begins, and a done
event on completion.
This is useful if you would like simple notifications about the compile process.
Caution! The start
and done
events are not intended for replacing the standard Grunt API for configuring and running tasks.
Here is a simple example using them: