diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-04-14 09:51:56 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-04-14 09:51:56 +0200 |
commit | d18cc9239614d145b7224260ba5787c149ed46d3 (patch) | |
tree | f2d76ae445dda4c969216f7261389cc3fa94915c /lib/template | |
parent | 8f63b4b7904940196c44621624042b345cddea76 (diff) | |
download | gitbook-d18cc9239614d145b7224260ba5787c149ed46d3.zip gitbook-d18cc9239614d145b7224260ba5787c149ed46d3.tar.gz gitbook-d18cc9239614d145b7224260ba5787c149ed46d3.tar.bz2 |
Pass template to block's context
Diffstat (limited to 'lib/template')
-rw-r--r-- | lib/template/index.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/template/index.js b/lib/template/index.js index 087ac59..c9ca66f 100644 --- a/lib/template/index.js +++ b/lib/template/index.js @@ -25,7 +25,7 @@ function normBlockResult(blk) { // Extract kwargs from an arguments array function extractKwargs(args) { - var last = _.last(args) + var last = _.last(args); return (_.isObject(last) && last.__keywords)? args.pop() : {}; } @@ -74,6 +74,7 @@ function TemplateEngine(output) { // Build context for this book with depreacted fields this.ctx = { + template: this, book: this.book, output: this.output }; |