summaryrefslogtreecommitdiffstats
path: root/lib/book.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-19 14:51:35 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-19 14:51:35 +0100
commitb314972195b18df43ad3eba6266ae1ba1b1873e3 (patch)
tree0765b59d5d270f89e93e78dc653f93630fb572e4 /lib/book.js
parent52179163dda6f52e0d64dc516c5612ac1e17be8f (diff)
downloadgitbook-b314972195b18df43ad3eba6266ae1ba1b1873e3.zip
gitbook-b314972195b18df43ad3eba6266ae1ba1b1873e3.tar.gz
gitbook-b314972195b18df43ad3eba6266ae1ba1b1873e3.tar.bz2
Add configuration to send structures files
Diffstat (limited to 'lib/book.js')
-rw-r--r--lib/book.js10
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 {};