summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/backbone/readme.js20
-rw-r--r--lib/backbone/summary.js1
-rw-r--r--lib/output/base.js1
3 files changed, 21 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);
})
diff --git a/lib/output/base.js b/lib/output/base.js
index a342c1e..c546061 100644
--- a/lib/output/base.js
+++ b/lib/output/base.js
@@ -248,6 +248,7 @@ Output.prototype.getContext = function() {
},
this.book.getContext(),
(this.book.isLanguageBook()? this.book.parent: this.book).langs.getContext(),
+ this.book.readme.getContext(),
this.book.summary.getContext(),
this.book.glossary.getContext(),
this.book.config.getContext(),