diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-04-18 12:49:31 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-04-18 12:49:31 +0200 |
commit | 0791b917f1191861e6320f48be95441102ae9ac7 (patch) | |
tree | b60d5c3160ef1ad8a173da86b5a9b428faeb8028 /lib/backbone | |
parent | ba182ce8e430f08bd8c60865b9c853875a3d6483 (diff) | |
download | gitbook-0791b917f1191861e6320f48be95441102ae9ac7.zip gitbook-0791b917f1191861e6320f48be95441102ae9ac7.tar.gz gitbook-0791b917f1191861e6320f48be95441102ae9ac7.tar.bz2 |
Add context for readme
Diffstat (limited to 'lib/backbone')
-rw-r--r-- | lib/backbone/readme.js | 20 | ||||
-rw-r--r-- | lib/backbone/summary.js | 1 |
2 files changed, 20 insertions, 1 deletions
diff --git a/lib/backbone/readme.js b/lib/backbone/readme.js index a4cd9d8..088a942 100644 --- a/lib/backbone/readme.js +++ b/lib/backbone/readme.js @@ -11,7 +11,25 @@ util.inherits(Readme, BackboneFile); Readme.prototype.type = 'readme'; -// Parse the readme content +/* + Return and extension of context to define the readme + + @retrun {Object} +*/ +Readme.prototype.getContext = function() { + return { + readme: { + path: this.path + } + }; +}; + +/* + Parse the readme content + + @param {String} content + @retrun {Promise} +*/ Readme.prototype.parse = function(content) { var that = this; diff --git a/lib/backbone/summary.js b/lib/backbone/summary.js index 9c8a38d..2dbcecb 100644 --- a/lib/backbone/summary.js +++ b/lib/backbone/summary.js @@ -231,6 +231,7 @@ Summary.prototype.getContext = function() { return { summary: { + path: this.path, parts: _.map(this.parts, function(part) { return part.getContext(onArticle); }) |