diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-04-25 10:32:44 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-04-25 10:32:44 +0200 |
commit | 4646ed8f4af184a33280d8fe1f978c7da5404725 (patch) | |
tree | b8c3102e539e4ff72a10536dd626c94ac5501b0c /lib/models | |
parent | 3f5c8acb3cdbf71c429ad331d23698cc53358746 (diff) | |
download | gitbook-4646ed8f4af184a33280d8fe1f978c7da5404725.zip gitbook-4646ed8f4af184a33280d8fe1f978c7da5404725.tar.gz gitbook-4646ed8f4af184a33280d8fe1f978c7da5404725.tar.bz2 |
Fix plugins loading
Diffstat (limited to 'lib/models')
-rw-r--r-- | lib/models/output.js | 9 | ||||
-rw-r--r-- | lib/models/plugin.js | 2 | ||||
-rw-r--r-- | lib/models/summary.js | 11 |
3 files changed, 21 insertions, 1 deletions
diff --git a/lib/models/output.js b/lib/models/output.js index 957d9d3..3e8dab8 100644 --- a/lib/models/output.js +++ b/lib/models/output.js @@ -31,6 +31,15 @@ Output.prototype.getAssets = function() { }; /** + Return logegr for this output (same as book) + + @return {Logger} +*/ +Output.prototype.getLogger = function() { + return this.getBook().getLogger(); +}; + +/** Create an Output instance from a book and a set of options @param {Book} book diff --git a/lib/models/plugin.js b/lib/models/plugin.js index 2f791dc..6891d7d 100644 --- a/lib/models/plugin.js +++ b/lib/models/plugin.js @@ -70,7 +70,7 @@ Plugin.prototype.isLoaded = function() { @return {Map<String:Function>} */ Plugin.prototype.getHooks = function() { - return this.getContent().get('hooks'); + return this.getContent().get('hooks') || Immutable.Map(); }; /** diff --git a/lib/models/summary.js b/lib/models/summary.js index f295a16..4ab2d68 100644 --- a/lib/models/summary.js +++ b/lib/models/summary.js @@ -27,6 +27,17 @@ Summary.prototype.getByLevel = function(level) { return SummaryArticle.getByLevel(this, level, 'getParts'); }; +/** + Return an article by its path + + @param {String} filePath + @return {Part|Article} +*/ +Summary.prototype.getByPath = function(filePath) { + // todo + + return undefined; +}; /** Create a new summary for a list of parts |