Skip to content

Papercut 0.9.0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 03 Nov 21:11
· 9 commits to main since this release

Added

  • Section and card titles can be headings: heading="1" to "4" on <x-doc::section> and <x-doc::card>, ->heading($level) on Section and Card. The title gets a PDF bookmark, a table of contents entry, an h tag in HTML and a Heading style in Word, and keeps its look. A numbered section's entry and bookmark read "2 Units".
  • Text::asHeading($level) makes any text a heading at levels 1 to 4 without the h1 to h4 look. Text::headingLevel() reads the level back, from either source.
  • Markup can keep its headings out of tables of contents: <x-doc::markup toc="false">, new MarkupOptions(toc: false), and a papercut.markup.toc config default. Every heading the tag converts is left out, wherever it sits; it still looks like a heading and keeps its PDF bookmark. In Word, an updated table of contents field brings them back, as with toc(false) on a heading.

Changed

  • Faster exports that use less memory. A 100-page table renders in about 0.86 s instead of 1.72 s and peaks at 114 MB instead of 342 MB, and the 10-page benchmark document takes 55 ms instead of 95 ms. Layout reuses the styles it already resolved, each distinct style is kept once, each page's layout caches are dropped when the page is done, an export frees what it used as soon as it returns, and common values are shared rather than copied. The PDF output is the same, except for the list spacing below.
  • An export runs with PHP's cycle collector paused and collects once when it ends. On long documents the collector ran repeatedly during layout and found nothing to free. Code that runs during the export runs with it paused too. The caller's setting is restored afterwards, also when the export throws.

Fixed

  • A list inside a table cell that sits in a list item kept no spacing below it in PDF output, as if it were nested in the outer list. A table cell starts outside any list, as HTML and Word export already treated it, so the list now gets the theme's list spacing.