summaryrefslogtreecommitdiffstats
path: root/lib/book.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-19 15:26:31 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-19 15:26:31 +0100
commit793600ab2fe3923062b06dd25e59655805882409 (patch)
treec385fbadece8b41b69dbd995a94744a1370f01e2 /lib/book.js
parent354b4afba1ddd1f86fb587da0c74388df89dbc28 (diff)
downloadgitbook-793600ab2fe3923062b06dd25e59655805882409.zip
gitbook-793600ab2fe3923062b06dd25e59655805882409.tar.gz
gitbook-793600ab2fe3923062b06dd25e59655805882409.tar.bz2
Improve test to test a all book
Diffstat (limited to 'lib/book.js')
-rw-r--r--lib/book.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/book.js b/lib/book.js
index f920100..5335896 100644
--- a/lib/book.js
+++ b/lib/book.js
@@ -128,13 +128,16 @@ Book.prototype.parseLangs = function() {
Book.prototype.parseSummary = function() {
var that = this;
- return that.findFile(that.config.getStructure("summary"))
- .then(function(summary) {
+ return Q.all([
+ that.findFile(that.config.getStructure("summary")),
+ that.findFile(that.config.getStructure("readme"))
+ ])
+ .spread(function(summary, readme) {
if (!summary) throw "No SUMMARY file";
return that.template.renderFile(summary.path)
.then(function(content) {
- return summary.parser.summary(content);
+ return summary.parser.summary(content, readme.path);
});
})
.then(function(summary) {
@@ -156,7 +159,7 @@ Book.prototype.parseGlossary = function() {
});
})
.then(function(glossary) {
- that.glossary = glossaryy;
+ that.glossary = glossary;
});
};