Skip to content

Commit

Permalink
Add tasks to create pdf and epub with gitbook and gitbook-pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
tcorral committed Apr 13, 2014
1 parent 715ef04 commit 5f27ea2
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var path = require("path");
var exec = require("child_process").exec;

module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-gitbook');
Expand Down Expand Up @@ -31,5 +32,27 @@ module.exports = function (grunt) {
'gh-pages',
'clean'
]);
grunt.registerTask('default', 'gitbook');
grunt.registerTask('pdf', function (grunt){
var done = this.async();
exec('gitbook pdf ./', function (err, stdout, stderr) {
if(err){
console.log('exec error:' + error);
}
console.log('stderr:', stderr);
console.log('stdout:', stdout);
done();
})
});
grunt.registerTask('epub', function (grunt){
var done = this.async();
exec('gitbook ebook ./', function (err, stdout, stderr) {
if(err){
console.log('exec error:' + error);
}
console.log('stderr:', stderr);
console.log('stdout:', stdout);
done();
})
});
grunt.registerTask('default', ['gitbook', 'pdf', 'epub']);
};

0 comments on commit 5f27ea2

Please sign in to comment.