diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-01-19 15:52:35 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-01-19 15:52:35 +0100 |
commit | 777963c97c41094555b1ea94b351adf380637922 (patch) | |
tree | 9e2b0702d23dcf53661355cf0ae4e9cad926366d /lib/book.js | |
parent | 2f3d6f8dff7d50fb1e60b90cbb3245dfec2fd4f6 (diff) | |
download | gitbook-777963c97c41094555b1ea94b351adf380637922.zip gitbook-777963c97c41094555b1ea94b351adf380637922.tar.gz gitbook-777963c97c41094555b1ea94b351adf380637922.tar.bz2 |
Change name of Book.init to Book.parse
Diffstat (limited to 'lib/book.js')
-rw-r--r-- | lib/book.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/book.js b/lib/book.js index 6c8fdbb..df19f74 100644 --- a/lib/book.js +++ b/lib/book.js @@ -39,7 +39,7 @@ var Book = function(root, options, parent) { }; // Initialize and parse the book: config, summary, glossary -Book.prototype.init = function() { +Book.prototype.parse = function() { var that = this; var multilingal = false; @@ -81,7 +81,7 @@ Book.prototype.init = function() { // Init sub-books return _.reduce(that.books, function(prev, book) { return prev.then(function() { - return book.init(); + return book.parse(); }); }, Q()); }) @@ -93,7 +93,7 @@ Book.prototype.init = function() { Book.prototype.generate = function() { var that = this; - return this.init() + return Q() .then(function() { }); @@ -219,4 +219,9 @@ Book.prototype.statFile = function(filename) { return fs.stat(path.join(this.root, filename)); }; +// Retrun true if the book is a multilingual book +Book.prototype.isMultilingual = function(filename) { + return this.books.length > 0; +}; + module.exports= Book; |