summaryrefslogtreecommitdiffstats
path: root/lib/configuration.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-19 12:06:04 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-19 12:06:04 +0100
commit60993d3123ef81f72e028dd496f26d3bbba0eec0 (patch)
tree0282d581d0469eb7e0dde645ff08985dc0736968 /lib/configuration.js
parent39b2aaf4898921fc845ffa165d038fa58404548d (diff)
downloadgitbook-60993d3123ef81f72e028dd496f26d3bbba0eec0.zip
gitbook-60993d3123ef81f72e028dd496f26d3bbba0eec0.tar.gz
gitbook-60993d3123ef81f72e028dd496f26d3bbba0eec0.tar.bz2
Parse langs and glossary
Diffstat (limited to 'lib/configuration.js')
-rw-r--r--lib/configuration.js16
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": [],