Files
gitbook/lib/index.js
T
Samy Pessé 8ed9f645fc Fix parsing of langs
Add command to build
2015-01-19 13:22:34 +01:00

27 lines
462 B
JavaScript

var Q = require("q");
var _ = require("lodash");
var path = require("path");
var Book = require("./book");
module.exports = {
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();
}
}
]
};