grunt-amd-doc
grunt-amd-doc is a grunt multi-task for amd-doc, a JavaScript documentation generator for AMD-based projects.
This plugin requires Grunt ~0.4.0
Installation
From the same directory as your Gruntfile, run
npm install grunt-amd-doc
Then add the following line to your Gruntfile:
grunt;
You can verify that the task is available by running grunt --help
and
checking that "amd-doc" is under "Available tasks".
Usage
grunt-amd-doc reads two sections of your config: amd-doc
and requirejs
.
amd-doc
can contain these properties (example from
deferreds.js):
'amd-doc': all: //Grunt files configuration object to process for documentation //(more: http://gruntjs.com/configuring-tasks) files: src: 'src/deferreds/**/*.js' options: //directory to output generated HTML (default = 'doc/out') out: 'doc/out' //directory to store jsdoc cache (default = 'doc/cache') cache: 'doc/cache' //directory to look for markdown mixins (default = 'doc/mixin') mixin: 'doc/mixin' //github URL where source is available. the file path and line number of //each documented variable will be added to this to make source links. repoview: 'https://github.com/zship/deferreds.js/blob/develop/' //Array of Type (see tasks/doc/Types.js) objects to transform into links //when used as parameter types, return types, or description namepaths types: { var types = ; //make all built-in types link to their MDN pages 'Number' 'String' 'Object' 'Function' 'Array' 'RegExp' 'Boolean'; types; types; types; types; types; types; types; return types; }
requirejs
is a standard r.js configuration
object.
grunt-amd-doc uses basePath
, paths
, and packages
(all optional) to
transform file names to AMD module names.
Once these options are in place, grunt amd-doc
will run amd-doc.