summaryrefslogtreecommitdiffstats
path: root/lib/index.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-23 15:51:19 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-23 15:51:19 +0100
commit77834f81665ca8d7eaec49be5da9f5562b46389a (patch)
tree30a6ffd4fe6e04f2b80a6330590270e8cd51bc3c /lib/index.js
parent0fc34e0a351186bf26740c0635977a6590975e0a (diff)
downloadgitbook-77834f81665ca8d7eaec49be5da9f5562b46389a.zip
gitbook-77834f81665ca8d7eaec49be5da9f5562b46389a.tar.gz
gitbook-77834f81665ca8d7eaec49be5da9f5562b46389a.tar.bz2
Accept format argument to build command
Diffstat (limited to 'lib/index.js')
-rw-r--r--lib/index.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/index.js b/lib/index.js
index 5f8648e..283b3c3 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -9,12 +9,16 @@ module.exports = {
Book: Book,
commands: [
+ // Build command that simply build a book into an output folder
{
name: "build",
description: "build a book",
exec: function(args, kwargs) {
var input = args[0] || process.cwd();
var output = args[1] || path.join(input, "_book");
+ kwargs = _.defaults(kwargs || {}, {
+ format: "website"
+ });
var book = new Book(input, _.extend({}, {
'output': output
@@ -22,10 +26,12 @@ module.exports = {
return book.parse()
.then(function() {
- return book.generate();
+ return book.generate(kwargs.format);
});
}
},
+
+ // Install command that install plugins needed by a book
{
name: "install",
description: "install plugins dependencies",