summaryrefslogtreecommitdiffstats
path: root/lib/book.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-03-07 11:00:01 +0100
committerSamy Pessé <samypesse@gmail.com>2016-03-07 11:00:01 +0100
commitb61254dda64b686e09e896e146d081519ced87d0 (patch)
tree68f078d7b9144bcf0c8346a37b60fbf98eeef15f /lib/book.js
parentb4bdf97cfe84994a4e2e04f196e0ebb4849b188f (diff)
downloadgitbook-b61254dda64b686e09e896e146d081519ced87d0.zip
gitbook-b61254dda64b686e09e896e146d081519ced87d0.tar.gz
gitbook-b61254dda64b686e09e896e146d081519ced87d0.tar.bz2
Add more deprecated api
Diffstat (limited to 'lib/book.js')
-rw-r--r--lib/book.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/book.js b/lib/book.js
index e4616f9..1d3a0d2 100644
--- a/lib/book.js
+++ b/lib/book.js
@@ -100,6 +100,12 @@ function Book(opts) {
var cfg = this.config.dump();
error.deprecateField(cfg, 'book', (this.output? this.output.name : null), '"options.generator" property is deprecated, use "output.name" instead');
+ // options.generator
+ cfg.generator = this.output? this.output.name : null;
+
+ // options.output
+ cfg.output = this.output? this.output.root() : null;
+
return cfg;
}
});
@@ -353,6 +359,13 @@ Book.prototype.isInLanguageBook = function(filename) {
});
};
+// ----- DEPRECATED METHODS
+
+Book.prototype.contentLink = error.deprecateMethod(function(s) {
+ return this.output.toURL(s);
+}, '.contentLink() is deprecated, use ".output.toURL()" instead');
+
+
// Initialize a book
Book.init = function(fs, root, opts) {
var book = new Book(_.extend(opts || {}, {