diff options
-rw-r--r-- | lib/configuration.js | 8 | ||||
-rw-r--r-- | lib/generators/ebook.js | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/configuration.js b/lib/configuration.js index 29776bd..9e839e6 100644 --- a/lib/configuration.js +++ b/lib/configuration.js @@ -246,6 +246,14 @@ Configuration.DEFAULT = { // Choices are [u’a0’, u’a1’, u’a2’, u’a3’, u’a4’, u’a5’, u’a6’, u’b0’, u’b1’, u’b2’, u’b3’, u’b4’, u’b5’, u’b6’, u’legal’, u’letter’] "paperSize": "a4", + // How to mark detected chapters. + // Choices are “pagebreak”, “rule”, "both" or “none”. + "chapterMark" : "pagebreak", + + // An XPath expression. Page breaks are inserted before the specified elements. + // To disable use the expression: "/" + "pageBreaksBefore": "/", + // Margin (in pts) // Note: 72 pts equals 1 inch "margin": { diff --git a/lib/generators/ebook.js b/lib/generators/ebook.js index cff9ef6..cdb667c 100644 --- a/lib/generators/ebook.js +++ b/lib/generators/ebook.js @@ -68,8 +68,6 @@ Generator.prototype.finish = function() { "--book-producer": "GitBook", "--publisher": "GitBook", "--chapter": "descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter ')]", - "--chapter-mark": "pagebreak", - "--page-breaks-before": "/", "--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 ')]", @@ -82,6 +80,8 @@ Generator.prototype.finish = function() { var pdfOptions = that.options.pdf; _.extend(_options, { + "--chapter-mark": String(pdfOptions.chapterMark), + "--page-breaks-before": String(pdfOptions.pageBreaksBefore), "--margin-left": String(pdfOptions.margin.left), "--margin-right": String(pdfOptions.margin.right), "--margin-top": String(pdfOptions.margin.top), |