summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/generate/ebook/index.js5
-rw-r--r--lib/parse/summary.js2
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/generate/ebook/index.js b/lib/generate/ebook/index.js
index 3ca53f9..6a9aa70 100644
--- a/lib/generate/ebook/index.js
+++ b/lib/generate/ebook/index.js
@@ -35,9 +35,12 @@ Generator.prototype.finish = function() {
"--title": that.options.title,
"--comments": that.options.description,
"--authors": that.options.author,
+ "--chapter": "descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter ')]",
+ "--chapter-mark": "pagebreak",
"--level1-toc": "descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-1 ')]",
"--level2-toc": "descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-2 ')]",
- "--level3-toc": "descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-3 ')]"
+ "--level3-toc": "descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-3 ')]",
+ "--no-chapters-in-toc": true
};
if (format == "pdf") {
diff --git a/lib/parse/summary.js b/lib/parse/summary.js
index 7a65532..21eadd1 100644
--- a/lib/parse/summary.js
+++ b/lib/parse/summary.js
@@ -102,6 +102,7 @@ function parseChapter(nodes, nums) {
function defaultChapterList(chapterList) {
var first = _.first(chapterList);
+ // Check if introduction node was specified in SUMMARY.md
if (first) {
var chapter = parseChapter(first, [0]);
@@ -111,6 +112,7 @@ function defaultChapterList(chapterList) {
}
}
+ // It wasn't specified, so add in default
return [
[ { type: 'text', text: '[Introduction](README.md)' } ]
].concat(chapterList);