diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/generate/generator.js | 8 | ||||
-rw-r--r-- | lib/generate/index.js | 3 | ||||
-rw-r--r-- | lib/generate/plugin.js | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/lib/generate/generator.js b/lib/generate/generator.js index d9ec286..9d50c92 100644 --- a/lib/generate/generator.js +++ b/lib/generate/generator.js @@ -9,6 +9,14 @@ var BaseGenerator = function(options) { this.options = options; this.options.plugins = Plugin.normalizeNames(this.options.plugins); + this.plugins = []; +}; + +BaseGenerator.prototype.loadPlugins = function() { + return Plugin.fromList(this.options.plugins) + .then(function(_plugins) { + this.plugins = _plugins; + }.bind(this)); }; BaseGenerator.prototype.convertFile = function(content, input) { diff --git a/lib/generate/index.js b/lib/generate/index.js index f0e945f..b82a8ca 100644 --- a/lib/generate/index.js +++ b/lib/generate/index.js @@ -71,9 +71,10 @@ var generate = function(options) { }) }) - // Create the generator + // Create the generator and load plugins .then(function() { generator = new generators[options.generator](options); + return generator.loadPlugins(); }) // Detect multi-languages book diff --git a/lib/generate/plugin.js b/lib/generate/plugin.js index 27c1cc9..1271eb3 100644 --- a/lib/generate/plugin.js +++ b/lib/generate/plugin.js @@ -83,7 +83,7 @@ Plugin.fromList = function(names) { .value(); return Q({ - 'plugins': plugins, + 'list': plugins, 'resources': resources }); }; |