diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-03-06 22:32:25 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-03-06 22:32:25 +0100 |
commit | 55a7b99b4d4b4902bed0d53fb1b219b0c5f4584a (patch) | |
tree | 5e33d27f7a61ee33ec1d341755475c7425a79ffe /lib/configuration.js | |
parent | 8bfba604b3ae1a51012499d726ea99c6f256035d (diff) | |
download | gitbook-55a7b99b4d4b4902bed0d53fb1b219b0c5f4584a.zip gitbook-55a7b99b4d4b4902bed0d53fb1b219b0c5f4584a.tar.gz gitbook-55a7b99b4d4b4902bed0d53fb1b219b0c5f4584a.tar.bz2 |
Fix #227: Add base rtl support for website
Diffstat (limited to 'lib/configuration.js')
-rw-r--r-- | lib/configuration.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/configuration.js b/lib/configuration.js index 7316dd8..578f4e2 100644 --- a/lib/configuration.js +++ b/lib/configuration.js @@ -96,17 +96,23 @@ Configuration.prototype.load = function() { } }) .then(function() { + if (!semver.satisfies(pkg.version, that.options.gitbook)) { + throw "GitBook version doesn't satisfy version required by the book: "+that.options.gitbook; + } + if (that.options.gitbook == "*") { + that.book.log.warn.ln("you should specify a gitbook version to use in your book.json, for example: "+(_.first(pkg.version.split("."))+".x.x")); + } + that.options.output = path.resolve(that.options.output || path.join(that.book.root, "_book")); that.options.plugins = normalizePluginsList(that.options.plugins); that.options.defaultsPlugins = normalizePluginsList(that.options.defaultsPlugins || ""); that.options.plugins = _.union(that.options.plugins, that.options.defaultsPlugins); that.options.plugins = _.uniq(that.options.plugins, "name"); - if (!semver.satisfies(pkg.version, that.options.gitbook)) { - throw "GitBook version doesn't satisfy version required by the book: "+that.options.gitbook; - } - if (that.options.gitbook == "*") { - that.book.log.warn.ln("you should specify a gitbook version to use in your book.json, for example: "+(_.first(pkg.version.split("."))+".x.x")); + // Default value for text direction (from language) + if (!that.options.direction) { + var lang = i18n.getByLanguage(that.options.language); + if (lang) that.options.direction = lang.direction; } that.options.gitbook = pkg.version; @@ -141,6 +147,7 @@ Configuration.DEFAULT = { "description": null, "isbn": null, "language": "en", + "direction": null, // version of gitbook to use "gitbook": "*", |