Mr. Doc grunt plugin automatically generates the documentation for your project.
This plugin requires Grunt ~0.4.5
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, you may install this plugin with this command:
npm install grunt-mrdoc --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-mrdoc');
In your project's Gruntfile, add a section named mrdoc
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
mrdoc: {
all: {
src: 'src',
target: 'docs',
options: {
// Task-specific options go here.
}
}
},
});
Type: String
Default value: 'test,public,static,views,templates'
A comma separated list of directories to ignore.
Type: String
Default value: ''
The title for produced page.
Type: String
Default value: 'html'
Target files extension.
Type: String
Default value:
The jade template file to use.
Type: String
Default value:
The theme to use.
Type: String
Default value: 'README.md'
The markdown file to use on the main page of the documentations.
In this example, the default options are used to automatically generates documentation of files in src
directory. The generated documentation is saved in target directory docs
.
grunt.initConfig({
mrdoc: {
all: {
src: 'src',
target: 'docs'
}
},
});
In this example, the custom options are used to change title and template of documentation page. The ignore option is used to prevent the documents generation for files in the directories: examples
and vendors
.
grunt.initConfig({
mrdoc: {
custom: {
src: 'src',
target: 'docs',
options: {
title: 'Mr. Doc',
ignore: 'examples,vendors',
template: 'templates/mrdoc.jade'
},
}
},
});
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
- 0.1.9: Fix path to mr-doc dep
- 0.1.5: Fix path to locate deps
- 0.1.4: Migrate for Mr. Doc
- 0.1.3: Adds support for theme
- 0.1.0: Initial release
Copyright (c) 2014-2015 Evertton de Lima. Licensed under the MIT license.