diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-24 12:56:26 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-24 12:56:26 +0100 |
commit | bd73c7978743329f893c1125d1645b8aa24eb7d8 (patch) | |
tree | 63a311016951e500478a39d97c30e9473f95854d /lib/output/base.js | |
parent | b244d506bd49526abbcfe84e2175b3410bbabb8c (diff) | |
download | gitbook-bd73c7978743329f893c1125d1645b8aa24eb7d8.zip gitbook-bd73c7978743329f893c1125d1645b8aa24eb7d8.tar.gz gitbook-bd73c7978743329f893c1125d1645b8aa24eb7d8.tar.bz2 |
Don't copy assets for each language book, but only for main book
Diffstat (limited to 'lib/output/base.js')
-rw-r--r-- | lib/output/base.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/output/base.js b/lib/output/base.js index fdddfe8..77c2d9f 100644 --- a/lib/output/base.js +++ b/lib/output/base.js @@ -96,6 +96,16 @@ Output.prototype.generate = function() { }); }) + // Generate sub-books + .then(function() { + if (!that.book.isMultilingual()) return; + + return Promise.serie(that.book.books, function(subbook) { + var out = that.onLanguageBook(subbook); + return out.generate(); + }); + }) + // Finish the generation .then(function() { that.log.debug.ln('finishing the generation'); @@ -179,6 +189,11 @@ Output.prototype.onResolveTemplate = function(from, to) { return path.resolve(path.dirname(from), to); }; +// Prepare output for a language book +Output.prototype.onLanguageBook = function(book) { + return new this.constructor(book, this.opts); +}; + // ---- Utilities ---- |