Skip to content

Commit

Permalink
add connect:docs task to automatically open built docs for verification
Browse files Browse the repository at this point in the history
change grunt live to auto-open as well
  • Loading branch information
Derek Olson committed Jul 17, 2015
1 parent 7006383 commit a6dc886
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions grunt/tasks/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = function(grunt) {
examplePath,
moduleList = [],
articleList = [],
tasks = ['copy:docs'];
tasks = ['clean:docs', 'replace:bower', 'copy:docs'];

if (mcheck.length !== modules.length) {
grunt.log.error("Documentation missing for some modules!!");
Expand Down Expand Up @@ -163,7 +163,7 @@ module.exports = function(grunt) {
]
});

grunt.registerTask('docs', ['clean:docs', 'build:dist', 'replace:bower', 'build:docs']);
grunt.registerTask('docs', ['build:dist', 'build:docs', 'connect:docs', 'watch']);

grunt.config('gh-pages', {
options: {
Expand Down
11 changes: 9 additions & 2 deletions grunt/tasks/live.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = function(grunt) {

});

grunt.registerTask('live', ['default','connect','watch']);
grunt.registerTask('live', ['default','connect:server','watch']);

grunt.config.set("watch", {
options: {
Expand All @@ -55,7 +55,7 @@ module.exports = function(grunt) {
},
docs: {
files: ['docs/*', 'src/mm-*/doc.json', 'src/mm-*/example.html'],
tasks: ['docs'],
tasks: ['build:docs'],
options: {
nospawn: true,
}
Expand Down Expand Up @@ -95,6 +95,7 @@ module.exports = function(grunt) {
grunt.config.set("connect", {
server: {
options: {
open: true,
middleware: function(connect, options) {
return [
function(req, res, next) {
Expand All @@ -121,6 +122,12 @@ module.exports = function(grunt) {
];
}
}
},
docs: {
options: {
open: true,
base: grunt.config('docs_dir')
}
}
});

Expand Down

0 comments on commit a6dc886

Please sign in to comment.