diff options
Diffstat (limited to 'lib/index.js')
-rw-r--r-- | lib/index.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/index.js b/lib/index.js index a968800..21bc6ff 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,5 +1,26 @@ +var Q = require("q"); +var _ = require("lodash"); +var path = require("path"); +var Book = require("./book"); module.exports = { - Book: require("./book") + Book: Book, + + commands: [ + { + name: "build", + description: "Build a book", + exec: function(args, kwargs) { + var input = args[0] || process.cwd(); + var output = args[1] || path.join(input, "_book"); + + var book = new Book(input, _.extend({}, { + 'output': output + })); + + return book.generate(); + } + } + ] }; |