diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-28 12:46:45 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-28 12:46:47 +0100 |
commit | 8cda844ef12cf87525024348c104413def02ed7f (patch) | |
tree | b82237a8101586e78d5fbf88f6bed0a06343556f /lib/book.js | |
parent | dde1ef92f0767f632fb722e828508a4ad882de31 (diff) | |
download | gitbook-8cda844ef12cf87525024348c104413def02ed7f.zip gitbook-8cda844ef12cf87525024348c104413def02ed7f.tar.gz gitbook-8cda844ef12cf87525024348c104413def02ed7f.tar.bz2 |
Export output for plugins context
Diffstat (limited to 'lib/book.js')
-rw-r--r-- | lib/book.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/book.js b/lib/book.js index 400296e..a678181 100644 --- a/lib/book.js +++ b/lib/book.js @@ -92,6 +92,20 @@ function Book(opts) { // List of page in the book this.pages = {}; + // Deprecation for templates + Object.defineProperty(this, 'options', { + get: function () { + this.log.warn.ln('"options" property is deprecated, use config.get(key) instead'); + var cfg = this.config.dump(); + error.deprecateField(cfg, 'book', (this.output? this.output.name : null), '"options.generator" property is deprecated, use "output.name" instead'); + + return cfg; + } + }); + + // Loop for template filters/blocks + error.deprecateField(this, 'book', this, '"book" property is deprecated, use "this" directly instead'); + _.bindAll(this); } |