summaryrefslogtreecommitdiffstats
path: root/lib/output/base.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/output/base.js')
-rw-r--r--lib/output/base.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/output/base.js b/lib/output/base.js
index 6ac3d7e..987179a 100644
--- a/lib/output/base.js
+++ b/lib/output/base.js
@@ -5,6 +5,7 @@ var path = require('path');
var Promise = require('../utils/promise');
var PluginsManager = require('../plugins');
var TemplateEngine = require('../template');
+var gitbook = require('../gitbook');
/*
Output is like a stream interface for a parsed book
@@ -117,6 +118,11 @@ Output.prototype.onAsset = function(filename) {
};
+// Finish the generation
+Output.prototype.finish = function() {
+
+};
+
// Resolve an HTML link
Output.prototype.onRelativeLink = function(currentPage, href) {
var to = this.book.getPage(href);
@@ -146,13 +152,16 @@ Output.prototype.onResolveTemplate = function(from, to) {
return path.resolve(path.dirname(from), to);
};
-// Finish the generation
-Output.prototype.finish = function() {
-
-};
-Output.createMixin = function(def) {
+// ---- Utilities ----
+Output.prototype.getPageContext = function(page) {
+ return _.extend(
+ page.getContext(),
+ gitbook.getContext(),
+ this.book.getContext(),
+ this.book.summary.getContext()
+ );
};
module.exports = Output;