Add better docs tasks

This commit is contained in:
Nick O'Leary 2018-04-24 16:48:32 +01:00
parent 5d064aa1d7
commit e6aeeea8c1
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
3 changed files with 33 additions and 2 deletions

View File

@ -407,6 +407,24 @@ module.exports = function(grunt) {
cwd: '<%= paths.dist %>/',
src: ['node-red-<%= pkg.version %>/**']
}
},
jsdoc : {
runtimeAPI: {
src: 'red/runtime-api/*.js',
options: {
destination: 'docs',
configure: './jsdoc.json'
}
}
},
jsdoc2md: {
runtimeAPI: {
options: {
separators: true
},
src: 'red/runtime-api/*.js',
dest: 'docs/runtime-api.md'
}
}
});
@ -425,6 +443,8 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-jsonlint');
grunt.loadNpmTasks('grunt-mocha-istanbul');
grunt.loadNpmTasks('grunt-webdriver');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-jsdoc-to-markdown');
grunt.registerMultiTask('attachCopyright', function() {
var files = this.data.src;
@ -507,4 +527,8 @@ module.exports = function(grunt) {
grunt.registerTask('coverage',
'Run Istanbul code test coverage task',
['build','mocha_istanbul:all']);
grunt.registerTask('docs',
'Generates API documentation',
['jsdoc','jsdoc2md']);
};

View File

@ -1,4 +1,9 @@
{
"opts": {
"template": "./node_modules/ink-docstrap/template",
"destination": "./docs",
"recurse": true
},
"tags": {
"allowUnknownTags": false,
"dictionaries": ["jsdoc"]

View File

@ -13,7 +13,7 @@
"start": "node red.js",
"test": "grunt",
"build": "grunt build",
"doc": "jsdoc --pedantic --recurse -c jsdoc.json -t ./node_modules/ink-docstrap/template"
"docs": "grunt docs"
},
"bin": {
"node-red": "./red.js",
@ -95,14 +95,16 @@
"grunt-contrib-jshint": "~1.1.0",
"grunt-contrib-uglify": "~3.3.0",
"grunt-contrib-watch": "~1.0.0",
"grunt-jsdoc": "^2.2.1",
"grunt-jsdoc-to-markdown": "^4.0.0",
"grunt-jsonlint": "~1.1.0",
"grunt-mocha-istanbul": "5.0.2",
"grunt-nodemon": "~0.4.2",
"grunt-sass": "~2.0.0",
"grunt-simple-mocha": "~0.4.1",
"grunt-webdriver": "^2.0.3",
"ink-docstrap": "^1.3.2",
"istanbul": "0.4.5",
"jsdoc": "3.5.5",
"mocha": "^5.1.1",
"should": "^8.4.0",
"sinon": "1.17.7",