A grunt task for running markdox.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tasks
.gitignore
.jshintrc
Gruntfile.js
package.json
readme.md

readme.md

grunt-markdox

A grunt task for running markdox.

This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International license.

Getting Started

This plugin requires Grunt ~0.4.1

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-markdox --save-dev

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

grunt.loadNpmTasks('grunt-markdox');

The "markdox" task

Overview

In your project's Gruntfile, add a section named markdox to the data object passed into grunt.initConfig().

grunt.initConfig({
    markdox: {
        options: {
            // Task-specific options go here.
        },
        your_target: {
            // Target-specific file lists and/or options go here.
        },
    },
})

Options

Type: String or Array Default value: {}

options.output

Type: String or Array Default value: undefined

The path of the file to write the generated documentation into.

options.formatter

Type: Function Default value: undefined

A formatting function that takes a docFile and returns it.

options.compiler

Type: Function Default value: undefined

A function that takes a filepath and data and returns the compiled data.

options.template

Type: String Default value: undefined

The template's filepath.

src

Type: String or Array Default value: undefined

A string pattern that represents a file or group of files or an array file names.

dest (shortcut to options.output)

Type: String or Array Default value: undefined

The path of the file to write the generated documentation into.

Usage Examples

Default Options

grunt.initConfig({
    markdox: {
        target: {
            files: [
                {src: 'src/file1.js', dest: 'docs/file1.md'},
                {src: 'src/file2.js', dest: 'docs/file2.md'}
            ]
        }
    },
})

Custom Options

grunt.initConfig({
    markdox: {
        options: {
            formatter: function (docfile) {
                return docfile;
            },
            compiler: function(filepath, data){
                return myCustomCompiler(data);
            },
            template: 'output.ejs'
        },
        target: {
            files: [
                {src: 'src/file1.js', dest: 'docs/file1.md'},
                {src: 'src/file2.js', dest: 'docs/file2.md'}
            ]
        }
    },
})