Skip to content

Commit 7be4b8d

Browse files
committed
Replace the grunt docs tasks with grunt-jsdoc
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.
1 parent 19bfd38 commit 7be4b8d

7 files changed

Lines changed: 28 additions & 60 deletions

File tree

Gruntfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = function (grunt) {
2121

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

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

26-
grunt.registerTask('tsdocs', ['clean:out', 'pixidoc', 'gitclone:plugins', 'exportdocjson', 'buildtsdoc:pixi', 'buildtsdoc:phaser', 'replace:phasertsdefheader', 'clean:out']);
26+
grunt.registerTask('tsdocs', ['clean:out', 'pixidoc', 'gitclone:plugins', 'jsdoc:json', 'buildtsdoc:pixi', 'buildtsdoc:phaser', 'replace:phasertsdefheader', 'clean:out']);
2727
};

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
"load-grunt-config": "~0.7.2",
4444
"yuidocjs": "^0.3.50",
4545
"jsdoc": "~3.3.0-alpha10",
46-
"grunt-jsdoc": "~0.5.7",
47-
"typescript-services": "~0.1.5",
48-
"grunt-git": "^0.3.3"
46+
"grunt-jsdoc": "~0.6.2-beta",
47+
"typescript-services": "~0.1.5",
48+
"grunt-git": "^0.3.3"
4949
}
5050
}

resources/jsdoc Export JSON/template/publish.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*/
55
'use strict';
66

7+
var path = require('jsdoc/path');
8+
79
function findClass(parentNode, className)
810
{
911
var elements =
@@ -109,5 +111,5 @@ exports.publish = function (data, opts) {
109111

110112
graft2(root, data().get());
111113
var fs = require('fs');
112-
fs.writeFileSync(opts.destination, JSON.stringify(root), 'utf8');
114+
fs.writeFileSync(path.join(env.opts.destination, 'docs.json'), JSON.stringify(root), 'utf8');
113115
};

src/physics/p2/p2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10158,7 +10158,7 @@ Capsule.prototype = new Shape();
1015810158
* @method conputeMomentOfInertia
1015910159
* @param {Number} mass
1016010160
* @return {Number}
10161-
* @todo
10161+
* @todo !
1016210162
*/
1016310163
Capsule.prototype.computeMomentOfInertia = function(mass){
1016410164
// Approximate with rectangle

tasks/builddoc.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

tasks/exportdocjson.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

tasks/options/jsdoc.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
html: {
3+
src: ['./README.md'],
4+
options: {
5+
configure: 'tasks/jsdoc-conf.json',
6+
/* 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 */
7+
destination: 'docs',
8+
private: false
9+
}
10+
},
11+
json: {
12+
src: [],
13+
options: {
14+
configure: 'tasks/jsdocexportjson-conf.json',
15+
/* The destination optios must be redefined event if there is always in the configure file otherwise, grunt-jsdoc overwrite it with its default value */
16+
destination: './out'
17+
}
18+
}
19+
};

0 commit comments

Comments
 (0)