summaryrefslogtreecommitdiffstats
path: root/lib/template
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-03-07 14:52:30 +0100
committerSamy Pessé <samypesse@gmail.com>2016-03-07 14:52:30 +0100
commit1d795076657f7f58fe15e647ad2a00dd37501ae0 (patch)
tree1fa6c0d6498a4b290afe44bbb59db1b3eaa75975 /lib/template
parentf05dc6788756892c56e38fec8e91a5d61d79716b (diff)
downloadgitbook-1d795076657f7f58fe15e647ad2a00dd37501ae0.zip
gitbook-1d795076657f7f58fe15e647ad2a00dd37501ae0.tar.gz
gitbook-1d795076657f7f58fe15e647ad2a00dd37501ae0.tar.bz2
Add book to templating context
Diffstat (limited to 'lib/template')
-rw-r--r--lib/template/index.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/template/index.js b/lib/template/index.js
index eb62549..078dd6c 100644
--- a/lib/template/index.js
+++ b/lib/template/index.js
@@ -70,9 +70,10 @@ function TemplateEngine(output) {
TemplateEngine.prototype.bindContext = function(func) {
var ctx = {
ctx: this.ctx,
- output: this.output,
- generator: this.output.name
+ book: this.book,
+ output: this.output
};
+ error.deprecateField(ctx, 'generator', this.output.name, '"generator" property is deprecated, use "output.generator" instead');
return _.bind(func, ctx);
};