mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-22 10:33:22 +00:00
Accept format argument to build command
This commit is contained in:
+7
-1
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user