Skip to content

Start a section on the next page by default - #280

Merged
zachhannum merged 4 commits into
mainfrom
fix/279-section-break-default
Oct 10, 2026
Merged

zachhannum merged 4 commits into
mainfrom
fix/279-section-break-default

Conversation

@zachhannum

Copy link
Copy Markdown
Owner

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 takes break-before: page. A stylesheet that wants a right-hand opening writes section { break-before: recto }.

Parts

  • ua.css gives section a break-before of page. 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, and docs/library/quickstart.md state 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 recto rule 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_before of the section is page.

  • 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-before rule for section. A host that wants the old result adds section { break-before: recto }.

  • On my machine, perf-gate reported 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 against main.

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.
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

The preview of this pull request is deleted.

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

CI — all green

job result time
test ✅ success 5m20s
e2e ✅ success 1m52s
wasm / bindings ✅ success 4m02s
perf ✅ success 5m32s
advisories ✅ success 0m26s

perf-gate — native

fleuron perf gate — native, best of 3

pride-and-prejudice — one column, no images, 307 pages, 9754 lines, 1357 KiB of PDF
  parse                1.6 ms
  style                4.8 ms
  line layout        223.9 ms
  fragment            12.7 ms
  layout             236.6 ms
  serialize           11.5 ms
  pdf                206.7 ms
  end to end         449.7 ms
  re-render           17.9 ms
  display structure      6244 KiB  digest 6a09955015c654f3
  layout              14.2 MiB peak
  session             38.8 MiB peak


  parse                1.6 ms   ceiling    20.0 ms      +92% headroom  ok
  end to end         449.7 ms   ceiling  1000.0 ms      +55% headroom  ok
  layout peak         14.2 MiB  ceiling    32.0 MiB     +56% headroom  ok
  re-render           17.9 ms   ceiling    20.0 ms      +10% headroom  ok
  session peak        38.8 MiB  ceiling    64.0 MiB     +39% headroom  ok

pride-and-prejudice — two columns, no images, 320 pages, 20215 lines, 1399 KiB of PDF
  parse                1.5 ms
  style                4.6 ms
  line layout        178.6 ms
  fragment            19.0 ms
  layout             195.0 ms
  serialize           12.2 ms
  pdf                215.8 ms
  end to end         416.9 ms
  re-render           25.2 ms
  display structure      6531 KiB  digest ddc2d3962a10a963
  layout              17.0 MiB peak
  session             51.1 MiB peak


  parse                1.5 ms   ceiling    20.0 ms      +92% headroom  ok
  end to end         416.9 ms   ceiling  1000.0 ms      +58% headroom  ok
  layout peak         17.0 MiB  ceiling    32.0 MiB     +47% headroom  ok
  re-render           25.2 ms   ceiling    20.0 ms      -26% headroom  OVER
  session peak        51.1 MiB  ceiling    64.0 MiB     +20% headroom  ok

pride-and-prejudice — one column, an image a chapter, 334 pages, 9754 lines, 1405 KiB of PDF
  parse                1.6 ms
  style                4.9 ms
  line layout        224.5 ms
  fragment            87.4 ms
  layout             539.5 ms
  serialize           11.7 ms
  pdf                206.4 ms
  end to end         752.3 ms
  re-render          324.5 ms
  display structure      6266 KiB  digest ec476e93ef01c2a8
  layout              14.5 MiB peak
  session             49.8 MiB peak


  parse                1.6 ms   ceiling    20.0 ms      +92% headroom  ok
  end to end         752.3 ms   ceiling  1000.0 ms      +25% headroom  ok
  layout peak         14.5 MiB  ceiling    32.0 MiB     +55% headroom  ok
  re-render          324.5 ms   ceiling   500.0 ms      +35% headroom  ok
  session peak        49.8 MiB  ceiling    64.0 MiB     +22% headroom  ok

pride-and-prejudice — two columns, an image a chapter, 342 pages, 20215 lines, 1439 KiB of PDF
  parse                1.6 ms
  style                4.9 ms
  line layout        179.0 ms
  fragment            91.1 ms
  layout             450.5 ms
  serialize           12.6 ms
  pdf                212.4 ms
  end to end         669.3 ms
  re-render          289.7 ms
  display structure      6538 KiB  digest 5affd7079ebe5775
  layout              17.0 MiB peak
  session             61.9 MiB peak


  parse                1.6 ms   ceiling    20.0 ms      +92% headroom  ok
  end to end         669.3 ms   ceiling  1000.0 ms      +33% headroom  ok
  layout peak         17.0 MiB  ceiling    32.0 MiB     +47% headroom  ok
  re-render          289.7 ms   ceiling   500.0 ms      +42% headroom  ok
  session peak        61.9 MiB  ceiling    64.0 MiB      +3% headroom  ok

monte-cristo — one column, no images, 1185 pages, 38917 lines, 5149 KiB of PDF
  parse                7.9 ms
  style               25.5 ms
  line layout        865.2 ms
  fragment            58.4 ms
  layout             913.5 ms
  serialize           47.6 ms
  pdf                786.8 ms
  end to end        1733.7 ms
  re-render           88.6 ms
  display structure     23903 KiB  digest 8f1298847615228a
  layout              54.6 MiB peak
  session            152.2 MiB peak


1 budget(s) over ceiling
warning only: pass --strict to fail on this

perf-gate — wasm

fleuron perf gate — wasm, best of 3

pride-and-prejudice — one column, no images, 307 pages, 9754 lines, 1357 KiB of PDF
  parse                3.9 ms
  style                7.5 ms
  line layout        333.7 ms
  fragment            16.2 ms
  layout             345.9 ms
  serialize           28.9 ms
  pdf                301.6 ms
  end to end         658.8 ms
  re-render           23.3 ms
  display structure      6244 KiB  digest 6a09955015c654f3
  layout              13.1 MiB peak
  session             34.7 MiB peak


  parse                3.9 ms   ceiling    20.0 ms      +81% headroom  ok
  layout + wire      374.7 ms   ceiling   500.0 ms      +25% headroom  ok
  layout peak         13.1 MiB  ceiling    32.0 MiB     +59% headroom  ok
  re-render           23.3 ms   ceiling    20.0 ms      -16% headroom  OVER
  session peak        34.7 MiB  ceiling    64.0 MiB     +46% headroom  ok

pride-and-prejudice — two columns, no images, 320 pages, 20215 lines, 1399 KiB of PDF
  parse                3.8 ms
  style                7.3 ms
  line layout        267.6 ms
  fragment            23.4 ms
  layout             290.4 ms
  serialize           30.2 ms
  pdf                319.1 ms
  end to end         620.7 ms
  re-render           31.2 ms
  display structure      6531 KiB  digest ddc2d3962a10a963
  layout              14.9 MiB peak
  session             43.0 MiB peak


  parse                3.8 ms   ceiling    20.0 ms      +81% headroom  ok
  layout + wire      320.6 ms   ceiling   500.0 ms      +36% headroom  ok
  layout peak         14.9 MiB  ceiling    32.0 MiB     +54% headroom  ok
  re-render           31.2 ms   ceiling    20.0 ms      -56% headroom  OVER
  session peak        43.0 MiB  ceiling    64.0 MiB     +33% headroom  ok

pride-and-prejudice — one column, an image a chapter, 334 pages, 9754 lines, 1405 KiB of PDF
  parse                3.9 ms
  style                7.6 ms
  line layout        329.4 ms
  fragment           146.0 ms
  layout             811.4 ms
  serialize           29.0 ms
  pdf                302.2 ms
  end to end        1125.1 ms
  re-render          489.9 ms
  display structure      6266 KiB  digest ec476e93ef01c2a8
  layout              13.3 MiB peak
  session             45.0 MiB peak


  parse                3.9 ms   ceiling    20.0 ms      +81% headroom  ok
  layout + wire      840.4 ms   ceiling   900.0 ms       +7% headroom  ok
  layout peak         13.3 MiB  ceiling    32.0 MiB     +58% headroom  ok
  re-render          489.9 ms   ceiling   500.0 ms       +2% headroom  ok
  session peak        45.0 MiB  ceiling    64.0 MiB     +30% headroom  ok

pride-and-prejudice — two columns, an image a chapter, 342 pages, 20215 lines, 1439 KiB of PDF
  parse                3.9 ms
  style                7.6 ms
  line layout        266.2 ms
  fragment           150.2 ms
  layout             690.9 ms
  serialize           30.2 ms
  pdf                316.2 ms
  end to end        1018.6 ms
  re-render          439.3 ms
  display structure      6538 KiB  digest 5affd7079ebe5775
  layout              14.9 MiB peak
  session             53.0 MiB peak


  parse                3.9 ms   ceiling    20.0 ms      +81% headroom  ok
  layout + wire      721.1 ms   ceiling   900.0 ms      +20% headroom  ok
  layout peak         14.9 MiB  ceiling    32.0 MiB     +53% headroom  ok
  re-render          439.3 ms   ceiling   500.0 ms      +12% headroom  ok
  session peak        53.0 MiB  ceiling    64.0 MiB     +17% headroom  ok

monte-cristo — one column, no images, 1185 pages, 38917 lines, 5149 KiB of PDF
  parse               17.2 ms
  style               39.6 ms
  line layout       1272.3 ms
  fragment            70.9 ms
  layout            1334.7 ms
  serialize          111.8 ms
  pdf               1145.1 ms
  end to end        2536.6 ms
  re-render          114.1 ms
  display structure     23903 KiB  digest 8f1298847615228a
  layout              50.3 MiB peak
  session            136.1 MiB peak


2 budget(s) over ceiling
warning only: pass --strict to fail on this

Full run · commit 4a39f2aa

@zachhannum
zachhannum merged commit 9197736 into main Oct 10, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The default stylesheet starts every section on a right-hand page

1 participant