thujikun / jsdoc3-grunt-template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsdoc3-grunt-template

Introduction

The template for grunt tasks by JSDoc3 uses: jsdoc3-bootstrap.

DEMO

Demo Page is here.

Usage

Install grunt-jsdoc on your project directory.

npm install grunt-jsdoc --save-dev

Clone this repository in template files directory of your project.

for example "jsdoc-templates/"

cd jsdoc-templates/
git clone git@github.com:thujikun/jsdoc3-grunt-template.git

Create grunt task for jsdoc.

jsdoc: {
    dist: {
        src: [
            './Gruntfile.js'
        ],
        options: {
            destination: 'docs/grunt/',
            configure: 'jsdoc-templates/jsdoc3-grunt-template/jsdoc.conf.json',
            template: 'jsdoc-templates/jsdoc3-grunt-template'
        },
    },
}

Write jsdoc comment in your Gruntfile.js.

/**
 * @function grunt
 * @desc default grunt task
 */
grunt.registerTask('default', [
    'your tasks'
]);

/**
 * @function grunt serve
 * @desc create server and watch
 */
grunt.registerTask('serve', [
    'connect',
    'watch'
]);

Modify document title in jsdoc.conf.json file templates.title section.

{
    "tags"      : {
        "allowUnknownTags" : true
    },
    "plugins"   : ["plugins/markdown"],
    "templates" : {
        "title" : "Your JSDoc Document Name"
    },
    "markdown"  : {
        "parser"   : "gfm",
        "hardwrap" : true
    }
}

Execute grunt jsdoc and you can get Document in destination directory!

You can also check Usage from demo.

License

MIT License

About


Languages

Language:CSS 65.3%Language:JavaScript 34.7%