diff options
Diffstat (limited to 'lib/book.js')
-rw-r--r-- | lib/book.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/book.js b/lib/book.js index bfe0a17..8c3561a 100644 --- a/lib/book.js +++ b/lib/book.js @@ -4,6 +4,7 @@ var path = require("path"); var fs = require("./utils/fs"); var Configuration = require("./configuration"); +var TemplateEngine = require("./template"); var parser = require("./parser"); var Book = function(root, options, parent) { @@ -21,6 +22,9 @@ var Book = function(root, options, parent) { } }); + // Template + this.template = new TemplateEngine(this); + // Summary this.summary = {}; @@ -82,7 +86,7 @@ Book.prototype.generate = function() { Book.prototype.parseLangs = function() { var that = this; - return that.findFile("LANGS") + return that.findFile(that.config.getStructure("langs")) .then(function(langs) { if (!langs) return []; @@ -100,7 +104,7 @@ Book.prototype.parseLangs = function() { Book.prototype.parseSummary = function() { var that = this; - return that.findFile("SUMMARY") + return that.findFile(that.config.getStructure("summary")) .then(function(summary) { if (!summary) throw "No SUMMARY file"; @@ -118,7 +122,7 @@ Book.prototype.parseSummary = function() { Book.prototype.parseGlossary = function() { var that = this; - return that.findFile("GLOSSARY") + return that.findFile(that.config.getStructure("glossary")) .then(function(glossary) { if (!glossary) return {}; |