summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@friendco.de>2014-04-16 00:18:35 -0700
committerAaron O'Mullan <aaron.omullan@friendco.de>2014-04-16 00:18:35 -0700
commitc9eb27bfe7b86987af5b1162804ebe3a8652c57e (patch)
treea023617d37b7640c73113ffdd2b90e774438919f
parentb78505c290d3d1a41be5e28fdecab8353494737e (diff)
downloadgitbook-c9eb27bfe7b86987af5b1162804ebe3a8652c57e.zip
gitbook-c9eb27bfe7b86987af5b1162804ebe3a8652c57e.tar.gz
gitbook-c9eb27bfe7b86987af5b1162804ebe3a8652c57e.tar.bz2
Do not pass SUMMARY.md to generator, fixes #93
We want to parse SUMMARY.md but not generate a file from it, thus it should be removed from the list of files to be processed by the generator
-rw-r--r--lib/generate/index.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/generate/index.js b/lib/generate/index.js
index 48bcaca..33edc1f 100644
--- a/lib/generate/index.js
+++ b/lib/generate/index.js
@@ -129,6 +129,15 @@ var generate = function(options) {
});
})
+ // Skip processing some files
+ .then(function() {
+ files = _.filter(files, function (file) {
+ return !(
+ file === 'SUMMARY.md'
+ );
+ });
+ })
+
// Copy file and replace markdown file
.then(function() {
return Q.all(
@@ -177,7 +186,7 @@ var generateFile = function(options) {
return Q.nfcall(tmp.dir)
.then(function(tmpDir) {
return generate(
- _.extend({},
+ _.extend({},
options,
{
output: tmpDir
@@ -195,7 +204,7 @@ var generateFile = function(options) {
_outputFile = _outputFile.slice(0, -path.extname(_outputFile).length)+"_"+lang+path.extname(_outputFile);
_tmpDir = path.join(_tmpDir, lang);
}
-
+
return fs.copy(
path.join(_tmpDir, "index."+ext),
_outputFile