summaryrefslogtreecommitdiffstats
path: root/lib/output/ebook.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-03-09 15:18:57 +0100
committerSamy Pessé <samypesse@gmail.com>2016-03-09 15:18:57 +0100
commitd39f0d6ff01bb033a4afeb1f2eb449f933719b14 (patch)
tree4172644a021e28f0eb61c5eaa041bdf2a804d47f /lib/output/ebook.js
parentbdbfbf7300ed6df752db996dfd865a695e0532fc (diff)
downloadgitbook-d39f0d6ff01bb033a4afeb1f2eb449f933719b14.zip
gitbook-d39f0d6ff01bb033a4afeb1f2eb449f933719b14.tar.gz
gitbook-d39f0d6ff01bb033a4afeb1f2eb449f933719b14.tar.bz2
Add "output" variables for templating
Diffstat (limited to 'lib/output/ebook.js')
-rw-r--r--lib/output/ebook.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/output/ebook.js b/lib/output/ebook.js
index ace5255..b0b05ca 100644
--- a/lib/output/ebook.js
+++ b/lib/output/ebook.js
@@ -21,6 +21,15 @@ var EbookOutput = assetsInliner(_EbookOutput);
EbookOutput.prototype.name = 'ebook';
+// Return context for templating
+// Incldue type of ebbook generated
+EbookOutput.prototype.getSelfContext = function() {
+ var ctx = EbookOutput.super_.prototype.getSelfContext.apply(this);
+ ctx.format = this.opts.format;
+
+ return ctx;
+};
+
// Finish generation, create ebook using ebook-convert
EbookOutput.prototype.finish = function() {
var that = this;