55 *
66 * There are three main tasks:
77 *
8- * grunt - This is the default task, which builds the code, tests it
9- * using both jslint and mocha, and then minifies it.
8+ * grunt - This is the default task, which builds the code, tests it
9+ * using both jslint and mocha, and then minifies it.
1010 *
11- * grunt yui - This will build the inline documentation for p5.js.
11+ * grunt yui - This will build the inline documentation for p5.js.
1212 *
13- * grunt test - This rebuilds the source and runs the automated tests on
14- * both the minified and unminified code. If you need to debug
15- * a test suite in a browser, `grunt test --keepalive` will
16- * start the connect server and leave it running; the tests
17- * can then be opened at localhost:9001/test/test.html
13+ * grunt yui_dev - This will build the inline documentation but linking to
14+ * remote JS/CSS and assets so pages look correct in local
15+ * testing. "grunt yui" should be run to build docs ready
16+ * for production.
17+ *
18+ * grunt test - This rebuilds the source and runs the automated tests on
19+ * both the minified and unminified code. If you need to debug
20+ * a test suite in a browser, `grunt test --keepalive` will
21+ * start the connect server and leave it running; the tests
22+ * can then be opened at localhost:9001/test/test.html
1823 *
1924 * Note: `grunt test:nobuild` will skip the build step when running the tests,
2025 * and only runs the test files themselves through the linter: this can save
@@ -218,7 +223,25 @@ module.exports = function(grunt) {
218223
219224 // this builds the documentation for the codebase.
220225 yuidoc : {
221- compile : {
226+ prod : {
227+ name : '<%= pkg.name %>' ,
228+ description : '<%= pkg.description %>' ,
229+ version : '<%= pkg.version %>' ,
230+ url : '<%= pkg.homepage %>' ,
231+ options : {
232+ paths : [ 'src/' , 'lib/addons/' ] ,
233+ themedir : 'docs/yuidoc-p5-theme/' ,
234+
235+ // These helpers define URL paths to p5js.org resources
236+ // based on the value of the P5_SITE_ROOT environment variable.
237+ // Set it to '..' for production and leave it blank or
238+ // undefined for development.
239+ helpers : [ 'docs/yuidoc-p5-theme/helpers/helpers_prod.js' ] ,
240+
241+ outdir : 'docs/reference/'
242+ }
243+ } ,
244+ dev : {
222245 name : '<%= pkg.name %>' ,
223246 description : '<%= pkg.description %>' ,
224247 version : '<%= pkg.version %>' ,
@@ -231,7 +254,7 @@ module.exports = function(grunt) {
231254 // based on the value of the P5_SITE_ROOT environment variable.
232255 // Set it to '..' for production and leave it blank or
233256 // undefined for development.
234- helpers : [ 'docs/yuidoc-p5-theme/helpers/helpers .js' ] ,
257+ helpers : [ 'docs/yuidoc-p5-theme/helpers/helpers_dev .js' ] ,
235258
236259 outdir : 'docs/reference/'
237260 }
@@ -316,7 +339,8 @@ module.exports = function(grunt) {
316339 grunt . registerTask ( 'build' , [ 'browserify' , 'uglify' , 'requirejs' ] ) ;
317340 grunt . registerTask ( 'test' , [ 'jshint' , 'jscs' , 'build' , 'connect' , 'mocha' ] ) ;
318341 grunt . registerTask ( 'test:nobuild' , [ 'jshint:test' , 'jscs:test' , 'connect' , 'mocha' ] ) ;
319- grunt . registerTask ( 'yui' , [ 'yuidoc' ] ) ;
342+ grunt . registerTask ( 'yui' , [ 'yuidoc:prod' ] ) ;
343+ grunt . registerTask ( 'yui:dev' , [ 'yuidoc:dev' ] ) ;
320344 grunt . registerTask ( 'default' , [ 'test' ] ) ;
321345 grunt . registerTask ( 'saucetest' , [ 'connect' , 'saucelabs-mocha' ] ) ;
322346} ;
0 commit comments