Repository navigation
Start a section on the next page by default - #280
Merged
Merged
Conversation
The built-in sheet gave every section break-before: recto, so a copyright page or a dedication took a blank page before it. A section now takes break-before: page, and a sheet that wants a right-hand opening asks for it. Tests that depended on the blank verso write the recto rule in their own sheets.
Without the blank versos, Pride and Prejudice is 307 pages and The Count of Monte Cristo is 1185.
Contributor
|
The preview of this pull request is deleted. |
Contributor
CI — all green
perf-gate — nativeperf-gate — wasmFull run · commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #279
The built-in stylesheet gave every section
break-before: recto. A copyright page, a dedication, and a table of contents each took a blank page before them. A section now takesbreak-before: page. A stylesheet that wants a right-hand opening writessection { break-before: recto }.Parts
ua.cssgivessectionabreak-beforeofpage. Test:the_built_in_sheet_starts_a_section_on_the_next_page.A book of three one-page sections with no stylesheet of its own is three pages, and none is blank. Test:
three_one_page_sections_are_three_pages.section { break-before: recto; }in an author stylesheet still leaves a blank left-hand page. Test:a_sheet_that_asks_for_a_recto_still_gets_the_blank_verso.The comment above the rule, the README,
docs/css-subset.mdx,docs/reference/markdown.mdx, anddocs/library/quickstart.mdstate the default.The three new tests are in
crates/fleuron/tests/section_break.rs.What else moved
Tests that depended on the blank left-hand page now write the
rectorule in their own stylesheets. The page-to-section test over the gate novel does the same, because it needs blank pages to examine.The style tree snapshot changes in one place:
break_beforeof the section ispage.The perf harness still measures the built-in stylesheet, so the two novels lose their blank pages. Pride and Prejudice goes from 333 pages to 307, and The Count of Monte Cristo from 1254 to 1185. The README, the site, and CLAUDE.md carry the new page counts. I did not measure the timings in those tables again, because they come from a different machine.
For the reviewer
This changes the output of every book that has more than one section and no
break-beforerule forsection. A host that wants the old result addssection { break-before: recto }.On my machine,
perf-gatereported one timing warning: the re-render of the two-column Pride and Prejudice took 21.1 ms against a ceiling of 20 ms. I did not compare that againstmain.