DEPRECATED! Instead use Docma in your npm scripts.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


© 2017, Onur Yıldırım (@onury). MIT License.


No need for this grunt task anymore. Since Docma has a CLI; you can simply add Docma to your scripts section in your package.json:

"scripts": {
    "docs": "docma -c ./docma.config.json",
    // your other scripts

...and run:

npm run docs

Grunt task for Docma, a powerful JSDoc and Markdown to HTML documentation generator, with a cool template. See Docma documentation for details and a live demo.

Getting Started

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 i grunt-docma --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:


docma Task

Run this task with the grunt docma command.

Task targets and options may be specified according to the grunt Configuring tasks guide.

Task Options

Option Type Default Description
config Object|String (Default Config) Either a Docma configuration object, or a path to a Docma config file. See build configuration and default template options.
traceFatal Boolean|Number false On a fatal error (i.e. uncaughtException), Grunt exits the process without a stack trace. This option forces Grunt to output the stack trace. Possible integer values: 0 to 2. Set to 1 (or true) to only trace fatal errors. Set to 2 to also trace grunt warnings. This can also be achieved by the grunt --stack command.

Note that, if you set config option to a config-file path, you can also define src and dest within that configuration file. But if you additionally define these within the task configuration, it will be used instead.

CAUTION: Destination directory (dest) will be emptied before the build. Make sure you set dest to a correct path.

Example Task Configuration

    docma: {
        // Default options
        options: {
            // Task specific options
            traceFatal: true, // (0|false)|(1|true)|2
            // Docma specific config
            // See all @
            config: {
                jsdoc: {
                    encoding: 'utf8',
                    recurse: false,
                    pedantic: false,
                    access: null, // ['public', 'protected'],
                    package: null,
                    module: true,
                    undocumented: false,
                    undescribed: false,
                    hierarchy: true,
                    sort: 'alphabetic',
                    // 'relativePath': '../code',
                    filter: null,
                    plugins: []
                debug: 0
        // your task target
        code: {
            // target specific options
            options: {
                // Docma config
                // See
                config: {
                    template: {
                        path: 'default',
                        // See all default-template options @
                        options: {
                            sidebar: true,
                            collapsed: false,
                            badges: true,
                            search: true,
                            toolbar: true,
                            outline: "tree",
                            animations: true,
                            symbolMeta: false,
                            navbar: true
                    app: {
                        title: 'Documentation',
                        routing: 'query'
            // files to be processed
            src: [
            dest: './test/doc'
        // another task target that reads Docma config from file
        fromFile: {
            options: {
                config: './test/docma.config.json'
            // overwrites src and dest defined in config file, if any.
            src: [
            dest: './test/doc2'

Change Log


  • Updated Docma core and dependencies. See Docma for changes.


  • Updated Docma core and dependencies.


  • Updated Docma core and dependencies.


  • Updated Docma core and dependencies.


  • Updated dependencies (including Docma) to their latest versions.


  • Fix package version.


  • Updated Docma to initial release version 1.0.0. See Docma documentation for (breaking) changes.


  • Task fails and aborts with stack and warnings instead of outputting only the stack.
  • Updated tests.

v0.5.2 (2016-05-22)

  • Added config from file support.
  • Updated Docma core.
  • Minor revisions.

v0.5.0 (2016-05-20)

  • Initial commit.