Skip to content

Commit

Permalink
Replace the grunt docs tasks with grunt-jsdoc
Browse files Browse the repository at this point in the history
Replace builddoc and exportdocjson grunt tasks with grunt-jsdoc.
To avoid an error I added a fake comment to a @todo param in the p2.js
file.
  • Loading branch information
vbornand committed Jan 22, 2015
1 parent 19bfd38 commit 7be4b8d
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 60 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = function (grunt) {

grunt.registerTask('dist', ['replace:pixi', 'replace:p2', 'build', 'copy']);

grunt.registerTask('docs', [ 'clean:docs', 'pixidoc', 'builddoc', 'replace:docs', 'clean:out']);
grunt.registerTask('docs', [ 'clean:docs', 'pixidoc', 'jsdoc:html', 'replace:docs', 'clean:out']);

grunt.registerTask('tsdocs', ['clean:out', 'pixidoc', 'gitclone:plugins', 'exportdocjson', 'buildtsdoc:pixi', 'buildtsdoc:phaser', 'replace:phasertsdefheader', 'clean:out']);
grunt.registerTask('tsdocs', ['clean:out', 'pixidoc', 'gitclone:plugins', 'jsdoc:json', 'buildtsdoc:pixi', 'buildtsdoc:phaser', 'replace:phasertsdefheader', 'clean:out']);
};
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"load-grunt-config": "~0.7.2",
"yuidocjs": "^0.3.50",
"jsdoc": "~3.3.0-alpha10",
"grunt-jsdoc": "~0.5.7",
"typescript-services": "~0.1.5",
"grunt-git": "^0.3.3"
"grunt-jsdoc": "~0.6.2-beta",
"typescript-services": "~0.1.5",
"grunt-git": "^0.3.3"
}
}
4 changes: 3 additions & 1 deletion resources/jsdoc Export JSON/template/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*/
'use strict';

var path = require('jsdoc/path');

function findClass(parentNode, className)
{
var elements =
Expand Down Expand Up @@ -109,5 +111,5 @@ exports.publish = function (data, opts) {

graft2(root, data().get());
var fs = require('fs');
fs.writeFileSync(opts.destination, JSON.stringify(root), 'utf8');
fs.writeFileSync(path.join(env.opts.destination, 'docs.json'), JSON.stringify(root), 'utf8');
};
2 changes: 1 addition & 1 deletion src/physics/p2/p2.js
Original file line number Diff line number Diff line change
Expand Up @@ -10158,7 +10158,7 @@ Capsule.prototype = new Shape();
* @method conputeMomentOfInertia
* @param {Number} mass
* @return {Number}
* @todo
* @todo !
*/
Capsule.prototype.computeMomentOfInertia = function(mass){
// Approximate with rectangle
Expand Down
27 changes: 0 additions & 27 deletions tasks/builddoc.js

This file was deleted.

26 changes: 0 additions & 26 deletions tasks/exportdocjson.js

This file was deleted.

19 changes: 19 additions & 0 deletions tasks/options/jsdoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
html: {
src: ['./README.md'],
options: {
configure: 'tasks/jsdoc-conf.json',
/* The destination and private options must be redefined event if there are always in the configure file otherwise, grunt-jsdoc overwrite it with its default values */
destination: 'docs',
private: false
}
},
json: {
src: [],
options: {
configure: 'tasks/jsdocexportjson-conf.json',
/* The destination optios must be redefined event if there is always in the configure file otherwise, grunt-jsdoc overwrite it with its default value */
destination: './out'
}
}
};

0 comments on commit 7be4b8d

Please sign in to comment.