summaryrefslogtreecommitdiffstats
path: root/lib/book.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/book.js')
-rw-r--r--lib/book.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/book.js b/lib/book.js
index ce368a3..913df2f 100644
--- a/lib/book.js
+++ b/lib/book.js
@@ -168,6 +168,8 @@ Book.prototype.parse = function() {
}
return Promise()
+
+ // Parse the readme
.then(that.readme.load)
.then(function() {
if (that.readme.exists()) return;
@@ -175,13 +177,21 @@ Book.prototype.parse = function() {
throw new Error('No README file (or is ignored)');
})
+ // Parse the summary
.then(that.summary.load)
.then(function() {
- if (that.summary.exists()) return;
+ if (!that.summary.exists()) {
+ throw new Error('No SUMMARY file (or is ignored)');
+ }
- throw new Error('No SUMMARY file (or is ignored)');
+ // Index summary's articles
+ that.summary.walk(function(article) {
+ if (!article.hasLocation()) return;
+ that.addPage(article.filename);
+ });
})
+ // Parse the glossary
.then(that.glossary.load);
});
};