Skip to content

Commit

Permalink
Merge pull request #530 from ndw/iss-522
Browse files Browse the repository at this point in the history
Support all(?) of the landscape and portrait combinations
  • Loading branch information
ndw authored Oct 20, 2024
2 parents 6a1a343 + 8d55d74 commit 06512d0
Show file tree
Hide file tree
Showing 24 changed files with 11,532 additions and 206 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class TestCase {
'profile-outputformat': 'print',
'resource-base-uri': '',
'dynamic-profiles': 'true']
if (name.startsWith("book.")) {
if (name.startsWith("book.") || name.startsWith("orient-pb") || name.startsWith("orient-lb")) {
printParams['page-style'] = 'book'
}

Expand Down
1 change: 1 addition & 0 deletions src/main/scss/docbook-paged.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use 'fonts-print';
@use 'media-all';
@use 'page-setup';
@use 'orientation';
@use 'media-paged';
17 changes: 17 additions & 0 deletions src/main/scss/media-paged.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
hyphens: auto;
}

/* This comes after the orientation configuration. It establishes
a "title flow" for books before the first component. */
@each $pagesize in [A4, A5, Letter] {
html.book-style.#{$pagesize} body {
page: #{$pagesize}-book-title-flow;
}
html.book-style.#{$pagesize} body.landscape {
page: #{$pagesize}-book-title-flow-landscape;
}
html.book-style.#{$pagesize} body.draft {
page: #{$pagesize}-book-title-flow-portrait-draft;
}
html.book-style.#{$pagesize} body.draft.landscape {
page: #{$pagesize}-book-title-flow-landscape-draft;
}
}

body {
margin-left: 0;
margin-right: 0;
Expand Down
4,618 changes: 4,618 additions & 0 deletions src/main/scss/orientation.scss

Large diffs are not rendered by default.

135 changes: 1 addition & 134 deletions src/main/scss/page-setup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -331,80 +331,13 @@ html.book-style.Letter {
}
}

/* ============================================================ */
/* Pick the correct page style to start */

@each $pagesize in [A4, A5, Letter] {
html.article-style.#{$pagesize} body {
string-set: DocumentTitle "";
page: #{$pagesize}-article-flow-portrait;
}

html.article-style.#{$pagesize} body .db-bfs.portrait,
html.article-style.#{$pagesize} body .division.portrait,
html.article-style.#{$pagesize} body .component.portrait,
html.article-style.#{$pagesize} body .section.portrait,
html.article-style.#{$pagesize} body .formalobject.portrait,
html.article-style.#{$pagesize} body .informalobject.portrait,
html.article-style.#{$pagesize} body .list-of-titles.portrait {
page: #{$pagesize}-article-flow-portrait;
}

html.article-style.#{$pagesize} body.landscape {
string-set: DocumentTitle "";
page: #{$pagesize}-article-flow-landscape;
}
html.article-style.#{$pagesize} body .db-bfs.landscape,
html.article-style.#{$pagesize} body .division.landscape,
html.article-style.#{$pagesize} body .component.landscape,
html.article-style.#{$pagesize} body .section.landscape,
html.article-style.#{$pagesize} body .formalobject.landscape,
html.article-style.#{$pagesize} body .informalobject.landscape,
html.article-style.#{$pagesize} body .list-of-titles.landscape {
page: #{$pagesize}-article-flow-landscape;
}

html.article-style.#{$pagesize} body.draft.portrait {
string-set: DocumentTitle "";
page: #{$pagesize}-article-flow-portrait-draft;
}
html.article-style.#{$pagesize} body.draft.portrait,
html.article-style.#{$pagesize} body.draft.portrait .db-bfs,
html.article-style.#{$pagesize} body.draft.portrait .division,
html.article-style.#{$pagesize} body.draft.portrait .component,
html.article-style.#{$pagesize} body.draft.portrait .section,
html.article-style.#{$pagesize} body.draft.portrait .formalobject,
html.article-style.#{$pagesize} body.draft.portrait .informalobject,
html.article-style.#{$pagesize} body.draft.portrait .list-of-titles,
html.article-style.#{$pagesize} body .db-bfs.draft.portrait,
html.article-style.#{$pagesize} body .division.draft.portrait,
html.article-style.#{$pagesize} body .component.draft.portrait,
html.article-style.#{$pagesize} body .section.draft.portrait,
html.article-style.#{$pagesize} body .formalobject.draft.portrait,
html.article-style.#{$pagesize} body .informalobject.draft.portrait,
html.article-style.#{$pagesize} body .list-of-titles.draft.portrait {
page: #{$pagesize}-article-flow-portrait-draft;
}

html.article-style.#{$pagesize} body.draft.landscape {
string-set: DocumentTitle "";
page: #{$pagesize}-article-flow-landscape-draft;
}
html.article-style.#{$pagesize} body .db-bfs.draft.landscape,
html.article-style.#{$pagesize} body .division.draft.landscape,
html.article-style.#{$pagesize} body .component.draft.landscape,
html.article-style.#{$pagesize} body .section.draft.landscape,
html.article-style.#{$pagesize} body .formalobject.draft.landscape,
html.article-style.#{$pagesize} body .informalobject.draft.landscape,
html.article-style.#{$pagesize} body .list-of-titles.draft.landscape {
page: #{$pagesize}-article-flow-landscape-draft;
}
}

@each $pagesize in [A4, A5, Letter] {
html.book-style.#{$pagesize} body {
page: #{$pagesize}-book-title-flow-portrait;
}

html.book-style.#{$pagesize} body .list-of-titles {
counter-reset: page;
}
Expand All @@ -413,72 +346,6 @@ html.book-style.Letter {
html.book-style.#{$pagesize} body .component,
html.book-style.#{$pagesize} body .list-of-titles {
break-before: right;
page: #{$pagesize}-book-flow-portrait;
}

html.book-style.#{$pagesize} body .division.portrait,
html.book-style.#{$pagesize} body .component.portrait,
html.book-style.#{$pagesize} body .list-of-titles.portrait {
break-before: right;
page: #{$pagesize}-book-flow-portrait;
}

html.book-style.#{$pagesize} body .section.portrait,
html.book-style.#{$pagesize} body .formalobject.portrait,
html.book-style.#{$pagesize} body .informalobject.portrait {
page: #{$pagesize}-book-flow-portrait;
}

html.book-style.#{$pagesize} body.landscape {
page: #{$pagesize}-book-title-flow-landscape;
}
html.book-style.#{$pagesize} body .division.landscape,
html.book-style.#{$pagesize} body .component.landscape,
html.book-style.#{$pagesize} body .list-of-titles.landscape {
break-before: right;
page: #{$pagesize}-book-flow-landscape;
}
html.book-style.#{$pagesize} body .section.landscape,
html.book-style.#{$pagesize} body .formalobject.landscape,
html.book-style.#{$pagesize} body .informalobject.landscape {
page: #{$pagesize}-book-flow-landscape;
}

html.book-style.#{$pagesize} body.draft.portrait {
page: #{$pagesize}-book-title-flow-portrait-draft;
}
html.book-style.#{$pagesize} body.draft,
html.book-style.#{$pagesize} body.draft.portrait,
html.book-style.#{$pagesize} body.draft.portrait .division,
html.book-style.#{$pagesize} body.draft.portrait .component,
html.book-style.#{$pagesize} body.draft.portrait .list-of-titles,
html.book-style.#{$pagesize} body.portrait .division.draft,
html.book-style.#{$pagesize} body.portrait .component.draft,
html.book-style.#{$pagesize} body.portrait .list-of-titles.draft,
html.book-style.#{$pagesize} body .division.draft.portrait,
html.book-style.#{$pagesize} body .component.draft.portrait,
html.book-style.#{$pagesize} body .list-of-titles.draft.portrait {
break-before: right;
page: #{$pagesize}-book-flow-portrait-draft;
}
html.book-style.#{$pagesize} body .section.draft.portrait,
html.book-style.#{$pagesize} body .formalobject.draft.portrait,
html.book-style.#{$pagesize} body .informalobject.draft.portrait {
page: #{$pagesize}-book-flow-portrait-draft;
}
html.book-style.#{$pagesize} body.draft.landscape {
page: #{$pagesize}-book-title-landscape-draft;
}
html.book-style.#{$pagesize} body .division.draft.landscape,
html.book-style.#{$pagesize} body .component.draft.landscape,
html.book-style.#{$pagesize} body .list-of-titles.draft.landscape {
break-before: right;
page: #{$pagesize}-book-landscape-draft;
}
html.book-style.#{$pagesize} body .section.draft.landscape,
html.book-style.#{$pagesize} body .formalobject.draft.landscape,
html.book-style.#{$pagesize} body .informalobject.draft.landscape {
page: #{$pagesize}-book-landscape-draft;
}
}

Expand Down
Loading

0 comments on commit 06512d0

Please sign in to comment.