diff options
Diffstat (limited to 'lib/book.js')
-rw-r--r-- | lib/book.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/book.js b/lib/book.js index 2782544..417af37 100644 --- a/lib/book.js +++ b/lib/book.js @@ -70,7 +70,7 @@ var Book = function(root, context, parent) { this.files = []; // List of plugins - this.plugins = []; + this.plugins = {}; // Structure files this.summaryFile = null; @@ -327,7 +327,7 @@ Book.prototype.parsePlugins = function() { var failed = []; // Load plugins - that.plugins = _.map(that.options.plugins, function(plugin) { + var pluginsList = _.map(that.options.plugins, function(plugin) { var plugin = new Plugin(that, plugin.name); that.log.info("load plugin", plugin.name, "...."); @@ -343,7 +343,12 @@ Book.prototype.parsePlugins = function() { if (_.size(failed) > 0) return Q.reject(new Error("Error loading plugins: "+failed.join(",")+". Run 'gitbook install' to install plugins from NPM.")); that.log.info.ok(that.plugins.length+" plugins loaded"); - return Q(); + that.log.debug.ln("normalize plugins list"); + + return Plugin.normalize(pluginsList) + .then(function(_plugins) { + that.plugins = _plugins; + }); }; // Parse readme to extract defaults title and description |