summaryrefslogtreecommitdiffstats
path: root/lib/book.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/book.js')
-rw-r--r--lib/book.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/book.js b/lib/book.js
index 8c3561a..0f5d452 100644
--- a/lib/book.js
+++ b/lib/book.js
@@ -90,7 +90,7 @@ Book.prototype.parseLangs = function() {
.then(function(langs) {
if (!langs) return [];
- return that.readFile(langs.path)
+ return that.template.renderFile(langs.path)
.then(function(content) {
return langs.parser.langs(content);
});
@@ -108,7 +108,7 @@ Book.prototype.parseSummary = function() {
.then(function(summary) {
if (!summary) throw "No SUMMARY file";
- return that.readFile(summary.path)
+ return that.template.renderFile(summary.path)
.then(function(content) {
return summary.parser.summary(content);
});
@@ -126,7 +126,7 @@ Book.prototype.parseGlossary = function() {
.then(function(glossary) {
if (!glossary) return {};
- return that.readFile(glossary.path)
+ return that.template.renderFile(glossary.path)
.then(function(content) {
return glossary.parser.glossary(content);
});
@@ -174,4 +174,9 @@ Book.prototype.readFile = function(filename) {
);
};
+// Return stat for a file
+Book.prototype.statFile = function(filename) {
+ return fs.stat(path.join(this.root, filename));
+};
+
module.exports= Book;