summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-21 00:28:59 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-21 00:28:59 +0100
commit98e9848c4a5260800376255e00c58bec029a1565 (patch)
treec13b7f3e616ab44f83eded10602db3a7294124ec
parent42bb5fccb81ea9ce2b406b32502236d0f34e2e7b (diff)
downloadgitbook-98e9848c4a5260800376255e00c58bec029a1565.zip
gitbook-98e9848c4a5260800376255e00c58bec029a1565.tar.gz
gitbook-98e9848c4a5260800376255e00c58bec029a1565.tar.bz2
Add title to summary's parts
-rw-r--r--lib/backbone/summary.js4
-rw-r--r--package.json4
2 files changed, 5 insertions, 3 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)
};
})
diff --git a/package.json b/package.json
index 6b923b9..faed0fa 100644
--- a/package.json
+++ b/package.json
@@ -11,8 +11,8 @@
"resolve": "0.6.3",
"mkdirp": "0.5.1",
"error": "7.0.2",
- "gitbook-markdown": "1.0.2",
- "gitbook-asciidoc": "1.0.1",
+ "gitbook-markdown": "1.0.3",
+ "gitbook-asciidoc": "1.0.2",
"gitbook-plugin-highlight": "1.0.3",
"gitbook-plugin-sharing": "1.0.1",
"gitbook-plugin-search": "1.1.0",