diff --git a/.gitignore b/.gitignore index 5171c54..bf7a033 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ node_modules -npm-debug.log \ No newline at end of file +npm-debug.log +doc +matter-doc-theme \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index a87afab..e99fbfb 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -63,6 +63,20 @@ module.exports = function(grunt) { files: ['build/matter.js', 'demo/js/**/*.html', 'demo/js/**/*.js', 'demo/css/**/*.css'] } }, + yuidoc: { + compile: { + name: '<%= pkg.name %>.js Physics Engine API Documentation', + description: '<%= pkg.description %>', + version: '<%= pkg.version %>', + url: '<%= pkg.homepage %>', + options: { + paths: 'src', + themedir: 'matter-doc-theme', + outdir: 'doc', + linkNatives: true + } + } + } }); grunt.loadNpmTasks('grunt-contrib-concat'); @@ -71,8 +85,10 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-contrib-yuidoc'); grunt.registerTask('default', ['test', 'concat', 'uglify', 'copy']); grunt.registerTask('test', ['jshint']); grunt.registerTask('dev', ['connect:watch', 'watch']); + grunt.registerTask('doc', ['yuidoc']); }; \ No newline at end of file diff --git a/package.json b/package.json index ae42f28..9f4af45 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "grunt-contrib-concat": "~0.3.0", "grunt-contrib-connect": "~0.6.0", "grunt-contrib-copy": "~0.5.0", - "grunt-contrib-watch": "~0.5.3" + "grunt-contrib-watch": "~0.5.3", + "grunt-contrib-yuidoc": "~0.5.1" }, "scripts": { "dev": "npm install && grunt dev"