summaryrefslogtreecommitdiffstats
path: root/lib/configuration.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-21 23:04:55 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-21 23:04:55 +0100
commitf31a272b1f6a6cff6c3ec61e374ca993a83c4c1d (patch)
treeab882d27a96886864fae0b0c4e5329c359334ee5 /lib/configuration.js
parenta492c66321e4b32d77e0d5d6456c3a266c75111d (diff)
downloadgitbook-f31a272b1f6a6cff6c3ec61e374ca993a83c4c1d.zip
gitbook-f31a272b1f6a6cff6c3ec61e374ca993a83c4c1d.tar.gz
gitbook-f31a272b1f6a6cff6c3ec61e374ca993a83c4c1d.tar.bz2
Add options "input" that equals root of the book
Diffstat (limited to 'lib/configuration.js')
-rw-r--r--lib/configuration.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/configuration.js b/lib/configuration.js
index 708797d..10184c9 100644
--- a/lib/configuration.js
+++ b/lib/configuration.js
@@ -60,9 +60,19 @@ function normalizePluginsNames(plugins) {
var Configuration = function(book, options) {
+ var that = this;
+
this.book = book;
+
this.options = _.cloneDeep(Configuration.DEFAULT);
this.options = _.merge(this.options, options || {});
+
+ // options.input == book.root
+ Object.defineProperty(this.options, "input", {
+ get: function () {
+ return that.book.root;
+ }
+ });
};
// Read and parse the configuration