summaryrefslogtreecommitdiffstats
path: root/lib/backbone/summary.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/backbone/summary.js')
-rw-r--r--lib/backbone/summary.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/backbone/summary.js b/lib/backbone/summary.js
index d9253a7..f3994ca 100644
--- a/lib/backbone/summary.js
+++ b/lib/backbone/summary.js
@@ -164,6 +164,7 @@ A part of a ToC is a composed of a tree of articles.
function TOCPart(part) {
if (!(this instanceof TOCPart)) return new TOCPart(part);
+ this.title = part.title;
this.articles = _.map(part.articles || part.chapters, function(article) {
return new TOCArticle(article, this);
}, this);
@@ -225,7 +226,7 @@ Summary.prototype.parse = function(content) {
// Create first part if none
if (that.parts.length == 0) {
- that.parts.push(new TOCPart([]));
+ that.parts.push(new TOCPart({}));
}
// Add README as first entry
@@ -259,6 +260,7 @@ Summary.prototype.getContext = function() {
summary: {
parts: _.map(this.parts, function(part) {
return {
+ title: part.title,
articles: part.map(onArticle)
};
})