diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-03-09 15:18:57 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-03-09 15:18:57 +0100 |
commit | d39f0d6ff01bb033a4afeb1f2eb449f933719b14 (patch) | |
tree | 4172644a021e28f0eb61c5eaa041bdf2a804d47f /lib/output/base.js | |
parent | bdbfbf7300ed6df752db996dfd865a695e0532fc (diff) | |
download | gitbook-d39f0d6ff01bb033a4afeb1f2eb449f933719b14.zip gitbook-d39f0d6ff01bb033a4afeb1f2eb449f933719b14.tar.gz gitbook-d39f0d6ff01bb033a4afeb1f2eb449f933719b14.tar.bz2 |
Add "output" variables for templating
Diffstat (limited to 'lib/output/base.js')
-rw-r--r-- | lib/output/base.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/output/base.js b/lib/output/base.js index 9c2153d..201eade 100644 --- a/lib/output/base.js +++ b/lib/output/base.js @@ -221,10 +221,19 @@ Output.prototype.onLanguageBook = function(book) { // ---- Utilities ---- +// Return conetxt for the output itself +Output.prototype.getSelfContext = function() { + return { + name: this.name + }; +}; + // Return a default context for templates Output.prototype.getContext = function() { return _.extend( - {}, + { + output: this.getSelfContext() + }, this.book.getContext(), this.book.langs.getContext(), this.book.summary.getContext(), |