Skip to content

Commit d6d6cb8

Browse files
committed
fix bug with frontmatter not rendering
1 parent d2237d7 commit d6d6cb8

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

book-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ paginationConfig = {
55
'chapterTitleMarker': 'h2',
66
'flowElement': 'document.body',
77
'alwaysEven': true,
8-
'divideContents': false,
8+
'divideContents': true,
99
'columns': 2,
1010
'enableFrontmatter': true,
1111
'bulkPagesToAdd': 50,

book.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060
* body text.
6161
*
6262
* enableFrontmatter: true -- This resolves whether a table of contents, page\
63-
* headers and other frontmatter contents should be added upon page creation.
63+
* headers and other frontmatter contents should be added upon page creation.
64+
* Note: divideContents has to be true if one wants the frontmatter to render.
6465
*
6566
* bulkPagesToAdd: 50 -- This is the initial number of pages of each flowable
6667
* part (section, chapter). After this number is added, adjustments are made by
@@ -77,7 +78,7 @@
7778
*
7879
* frontmatterContents: none -- These are the HTML contents that are added to
7980
* the frontmatter before the table of contents. This would usually be a title
80-
* page and a copyright page, including page breaks.
81+
* page and a copyright page, including page breaks.
8182
*
8283
* autoStart: true -- This controls whether pagination should be executed
8384
* automatically upon page load. If it is set to false, pagination has to be
@@ -93,7 +94,8 @@
9394
* up less space than this, there is no need to do this division. The added
9495
* benefit of not doing it is that the original DOM of the part that contains
9596
* the conents will not be modified. Only the container element that holds the
96-
* contents will be assigned another CSS class.
97+
* contents will be assigned another CSS class. Note: divideContents has to be
98+
* true if one wants the frontmatter to render.
9799
*
98100
* Page style options
99101
*
@@ -735,7 +737,7 @@ Pagination.applyBookLayout = function () {
735737
fmObject = new Pagination.flowObject(
736738
'pagination-frontmatter',
737739
Pagination.pageCounters.roman,
738-
1
740+
false
739741
);
740742
fmObject.columns = 1;
741743
contentsDiv.insertBefore(fmObject.rawdiv, contentsDiv.firstChild);
@@ -830,6 +832,8 @@ Pagination.flowObject = function (name, pageCounter, rawdiv) {
830832
} else {
831833
this.rawdiv = document.createElement('div');
832834
}
835+
console.log(rawdiv);
836+
console.log(this.rawdiv);
833837
this.rawdiv.classList.add(name + '-contents');
834838
this.rawdiv.classList.add('pagination-contents-item');
835839

0 commit comments

Comments
 (0)