diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-04-25 22:30:41 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-04-25 22:30:41 +0200 |
commit | ab2ebefe2bb6dee75e064c1ad572749e3f8104d1 (patch) | |
tree | b6a09abe8726a04a57f69580bad3136dd5d4de60 /lib/models/plugin.js | |
parent | c34a9f6213c204c43c78dd691a5295d7e5a757e8 (diff) | |
download | gitbook-ab2ebefe2bb6dee75e064c1ad572749e3f8104d1.zip gitbook-ab2ebefe2bb6dee75e064c1ad572749e3f8104d1.tar.gz gitbook-ab2ebefe2bb6dee75e064c1ad572749e3f8104d1.tar.bz2 |
Copy resources from plugins to output folder
Diffstat (limited to 'lib/models/plugin.js')
-rw-r--r-- | lib/models/plugin.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/models/plugin.js b/lib/models/plugin.js index ed7ad82..372558b 100644 --- a/lib/models/plugin.js +++ b/lib/models/plugin.js @@ -74,6 +74,23 @@ Plugin.prototype.getHooks = function() { }; /** + Return infos about resources for a specific type + + @param {String} type + @return {Map<String:Mixed>} +*/ +Plugin.prototype.getResources = function(type) { + if (type != 'website' && type != 'ebook') { + throw new Error('Invalid assets type ' + type); + } + + var content = this.getContent(); + return (content.get(type) + || (type == 'website'? content.get('book') : null) + || Immutable.Map()); +}; + +/** Return map of filters @return {Map<String:Function>} */ |