Skip to content

Commit 2afce5c

Browse files
committed
Add documentation generator to project (JSDuck), and add examples to inline documentation in source code.
1 parent 5af8df4 commit 2afce5c

File tree

12 files changed

+439
-113
lines changed

12 files changed

+439
-113
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
.settings
44
web.config
55
.grunt/
6+
docs/
67
_SpecRunner.html
78
node_modules/

Gruntfile.js

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
/*global module */
1+
/*global require, module */
2+
/*jshint devel:true */
23
module.exports = function(grunt) {
34
'use strict';
45

6+
var exec = require( 'child_process' ).exec;
57
var banner = createBanner();
68

79
// Project configuration.
@@ -69,6 +71,23 @@ module.exports = function(grunt) {
6971
src: [ 'dist/Autolinker.js' ],
7072
dest: 'dist/Autolinker.min.js',
7173
}
74+
},
75+
76+
jsduck: {
77+
main: {
78+
// source paths with your code
79+
src: [
80+
'src/**/*.js'
81+
],
82+
83+
// docs output dir
84+
dest: 'docs',
85+
86+
// extra options
87+
options: {
88+
'title': 'Autolinker API Docs'
89+
}
90+
}
7291
}
7392
} );
7493

@@ -78,13 +97,13 @@ module.exports = function(grunt) {
7897
grunt.loadNpmTasks( 'grunt-contrib-concat' );
7998
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
8099
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
100+
grunt.loadNpmTasks( 'grunt-jsduck' );
81101

82102
// Tasks
83-
grunt.registerTask( 'default', [ 'lint', 'build', 'doTest' ] );
84-
grunt.registerTask( 'lint', [ 'jshint' ] );
85-
grunt.registerTask( 'test', [ 'build', 'doTest' ] );
86-
grunt.registerTask( 'doTest', [ 'jasmine' ] );
103+
grunt.registerTask( 'default', [ 'jshint', 'build', 'jasmine' ] );
87104
grunt.registerTask( 'build', [ 'concat:development', 'uglify:production' ] );
105+
grunt.registerTask( 'test', [ 'build', 'jasmine' ] );
106+
grunt.registerTask( 'doc', "Builds the documentation.", [ 'jshint', 'jsduck' ] );
88107
grunt.registerTask( 'serve', [ 'connect:server:keepalive' ] );
89108

90109

0 commit comments

Comments
 (0)