diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-04-26 15:23:28 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-04-26 15:23:28 +0200 |
commit | fa17f1671685a97e88c84fdba6a94744c54a09b8 (patch) | |
tree | 63083c0645a1f88bc7e96d891ef9ec9509d7680a /lib/output | |
parent | ce99c8c7061eb9b4a2a5f4ff534d7fbeaf37cad0 (diff) | |
download | gitbook-fa17f1671685a97e88c84fdba6a94744c54a09b8.zip gitbook-fa17f1671685a97e88c84fdba6a94744c54a09b8.tar.gz gitbook-fa17f1671685a97e88c84fdba6a94744c54a09b8.tar.bz2 |
Add base for commands
Improve plugins installation
Diffstat (limited to 'lib/output')
-rw-r--r-- | lib/output/index.js | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/lib/output/index.js b/lib/output/index.js index 9112666..9b8ec17 100644 --- a/lib/output/index.js +++ b/lib/output/index.js @@ -1,6 +1,24 @@ +var Immutable = require('immutable'); + +var generators = Immutable.List([ + require('./json'), + require('./website'), + require('./ebook') +]); + +/** + Return a specific generator by its name + + @param {String} + @return {Generator} +*/ +function getGenerator(name) { + return generators.find(function(generator) { + return generator.name == name; + }); +} + module.exports = { generate: require('./generateBook'), - JSONGenerator: require('./json'), - WebsiteGenerator: require('./website'), - EbookGenerator: require('./ebook') + getGenerator: getGenerator }; |