summaryrefslogtreecommitdiffstats
path: root/lib/index.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-19 13:22:34 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-19 13:22:34 +0100
commit8ed9f645fc7bd7e79290dcf7c855df33d3cda262 (patch)
treefbe80af8c02b15c928327cd4f6e347bab29e8c77 /lib/index.js
parent60993d3123ef81f72e028dd496f26d3bbba0eec0 (diff)
downloadgitbook-8ed9f645fc7bd7e79290dcf7c855df33d3cda262.zip
gitbook-8ed9f645fc7bd7e79290dcf7c855df33d3cda262.tar.gz
gitbook-8ed9f645fc7bd7e79290dcf7c855df33d3cda262.tar.bz2
Fix parsing of langs
Add command to build
Diffstat (limited to 'lib/index.js')
-rw-r--r--lib/index.js23
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();
+ }
+ }
+ ]
};