diff options
Diffstat (limited to 'lib/configuration.js')
-rw-r--r-- | lib/configuration.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/configuration.js b/lib/configuration.js index c5c1ba2..82bf010 100644 --- a/lib/configuration.js +++ b/lib/configuration.js @@ -6,7 +6,7 @@ var fs = require("./utils/fs"); var Configuration = function(book, options) { this.book = book; - this.options = _.defaults(options || {}, Configuration.DEFAULT); + this.options = _.extend({}, Configuration.DEFAULT, options || {}); }; // Read and parse the configuration @@ -16,7 +16,7 @@ Configuration.prototype.load = function() { return Q() .then(function() { try { - var _config = require(path.resolve(that.book.root, "book")); + var _config = require(path.resolve(that.book.root, that.options.)); that.options = _.merge( that.options, _.omit(_config, 'input', 'configFile', 'defaultsPlugins', 'generator') @@ -30,16 +30,16 @@ Configuration.prototype.load = function() { // Default configuration Configuration.DEFAULT = { + // Options that can't be extend + "configFile": "book", + "generator": "site", + "extension": null, + // Book metadats (somes are extracted from the README by default) "title": null, "description": null, "isbn": null, - - // For ebook format, the extension to use for generation (default is detected from output extension) - // "epub", "pdf", "mobi" - // Caution: it overrides the value from the command line - // It's not advised this option in the book.json - "extension": null, + "lang": "en", // Plugins list, can contain "-name" for removing default plugins "plugins": [], |