diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-28 14:47:34 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-28 14:47:34 +0100 |
commit | 4aa66338fce505566a2fe6ba6aee79ddf3f656a2 (patch) | |
tree | ffce4b558735f6a41228542f8c36e3a6ba1e562d /lib/book.js | |
parent | 8cda844ef12cf87525024348c104413def02ed7f (diff) | |
download | gitbook-4aa66338fce505566a2fe6ba6aee79ddf3f656a2.zip gitbook-4aa66338fce505566a2fe6ba6aee79ddf3f656a2.tar.gz gitbook-4aa66338fce505566a2fe6ba6aee79ddf3f656a2.tar.bz2 |
Add init command
Diffstat (limited to 'lib/book.js')
-rw-r--r-- | lib/book.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/book.js b/lib/book.js index a678181..09bd59f 100644 --- a/lib/book.js +++ b/lib/book.js @@ -13,6 +13,7 @@ var error = require('./utils/error'); var Promise = require('./utils/promise'); var Logger = require('./utils/logger'); var parsers = require('./parsers'); +var initBook = require('./init'); /* @@ -103,10 +104,10 @@ function Book(opts) { } }); + _.bindAll(this); + // Loop for template filters/blocks error.deprecateField(this, 'book', this, '"book" property is deprecated, use "this" directly instead'); - - _.bindAll(this); } // Return templating context for the book @@ -368,5 +369,11 @@ Book.setup = function(fs, root, opts) { }); }; +// Initialize a book +Book.init = function(fs, root, opts) { + return Book.setup(fs, root, opts) + .then(initBook); +}; + module.exports = Book; |