summaryrefslogtreecommitdiffstats
path: root/lib/output.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-01-28 16:27:29 +0100
committerSamy Pessé <samypesse@gmail.com>2016-01-28 16:27:29 +0100
commita063cc1a53bede0a869b184f5ec4793ce300ae01 (patch)
tree15b960ffaf0e3058cf7c5cc6e272ae4ad8f56731 /lib/output.js
parent36f2f5d52e54c03036f05225df3f58e9833f3e71 (diff)
downloadgitbook-a063cc1a53bede0a869b184f5ec4793ce300ae01.zip
gitbook-a063cc1a53bede0a869b184f5ec4793ce300ae01.tar.gz
gitbook-a063cc1a53bede0a869b184f5ec4793ce300ae01.tar.bz2
Add base for langs parsing
Diffstat (limited to 'lib/output.js')
-rw-r--r--lib/output.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/output.js b/lib/output.js
index 2e5bc65..d09f29d 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -19,6 +19,7 @@ Output.prototype.writeFile = function(filename, buf) {
// Start the generation, for a parsed book
Output.prototype.generate = function() {
var that = this;
+ var isMultilingual = this.isMultilingual();
return Promise()
@@ -33,9 +34,11 @@ Output.prototype.generate = function() {
})
.then(function(files) {
return Promise.serie(files, function(filename) {
- var isPage = that.book.hasPage(filename);
+ // Ignore file present in a language book
+ if (isMultilingual && that.book.isInLanguageBook(filename)) return;
- if (isPage) {
+ // Process file as page or asset
+ if (that.book.hasPage(filename)) {
return that.generator.writePage(that.book.getPage(filename));
} else {
return that.generator.writeAsset(filename);