summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-13 15:51:14 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-13 15:51:14 +0100
commit71059e3ea3ea9af156987a0dd4cb0a5457b0316c (patch)
treefd4d8fc8b279e6b0521bd8954c8d285abb5cdd7d /lib
parentee3faaad1106bb773078e580c9c1611c8f31607c (diff)
downloadgitbook-71059e3ea3ea9af156987a0dd4cb0a5457b0316c.zip
gitbook-71059e3ea3ea9af156987a0dd4cb0a5457b0316c.tar.gz
gitbook-71059e3ea3ea9af156987a0dd4cb0a5457b0316c.tar.bz2
Ignore Summary and Langs in output
Diffstat (limited to 'lib')
-rw-r--r--lib/output/base.js27
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/output/base.js b/lib/output/base.js
index 9acfb87..853fa30 100644
--- a/lib/output/base.js
+++ b/lib/output/base.js
@@ -28,7 +28,11 @@ function Output(book, type) {
'.bookignore',
// The configuration file should not be copied in the output
- this.book.config.path
+ this.book.config.path,
+
+ // Structure file to ignore
+ this.book.summary.path,
+ this.book.langs.path
]));
}
@@ -61,15 +65,20 @@ Output.prototype.generate = function() {
// We want to process assets first, then pages
// Since pages can have logic based on existance of assets
.then(function(files) {
- // Ignore file present in a language book
- files = _.filter(files, function(filename) {
- return !(isMultilingual && that.book.isInLanguageBook(filename));
- });
+ // Split into pages/assets
+ var byTypes = _.chain(files)
+ .filter(that.ignore.createFilter())
- // List assets
- var byTypes = _.groupBy(files, function(filename) {
- return (that.book.hasPage(filename)? 'page' : 'asset');
- });
+ // Ignore file present in a language book
+ .filter(function(filename) {
+ return !(isMultilingual && that.book.isInLanguageBook(filename));
+ })
+
+ .groupBy(function(filename) {
+ return (that.book.hasPage(filename)? 'page' : 'asset');
+ })
+
+ .value();
return Promise.serie(byTypes.asset, function(filename) {
return that.onAsset(filename);