Skip to content

Format samples made with the real app, and the PDF layout problems they showed - #13

Merged
triggeredcode merged 4 commits into
mainfrom
fix-format-samples
Oct 12, 2026
Merged

triggeredcode merged 4 commits into
mainfrom
fix-format-samples

Conversation

@triggeredcode

Copy link
Copy Markdown
Owner

Why

The third sample picture (Concept note) showed half a box under "How it works". It was a stand-in: the compile test drew a placeholder box where the diagram goes, and most sections were empty. Making real samples through the app showed two real PDF problems too.

What

  • Samples (docs/format-samples): each format has a note (*.lmd) with every section filled and a real diagram, table, math or chart. scripts/format-samples.mjs puts it into the built app as a page of its format and clicks Download PDF, so the pictures are what a person gets. A test checks every sample fills every section.
  • Empty page: a five-box flowchart drawn top to bottom was 546 pt high, nearly the whole page, so heading + diagram + caption fitted on no page and an empty page appeared. Figures are now at most 65% of the page, tall ones may float, and they may share a page with text. A test fails on the old layout.
  • Charts in the PDF had no colours of their own (pale cream bars on grey, which looked cut off). They use the same greys as on screen.
  • Tables: ragged right and a little more room between rows (justified words in narrow columns were pulled far apart).

Checked

Each commit passes typecheck, lint, format and unit tests (git rebase -x). The new tests fail on the old behaviour (mutation-checked). The five pictures were looked at one by one.

🤖 Generated with Claude Code

triggeredcode and others added 4 commits October 12, 2026 16:33
A five-box flowchart drawn top to bottom is about 546 pt high, nearly the whole 592 pt text area. With its heading and
caption it fits on no page, so the PDF got an empty page and the heading and diagram moved on to the one after.

Figures are now at most 65% of the text height (the drawing is fitted to the same box), a figure taller than 40% may float
to the top of the next page while the text that follows fills the page it leaves, and a figure may share a page with text.
A test compiles a note with such a diagram and checks that no page is empty; it fails on the old layout.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The PDF look had no chart colours, so Mermaid's default theme drew very pale cream bars on a grey background that made the
chart look cut off at the right edge. Bars and axes now use the same inks as the on-screen looks, on white.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tween rows

In narrow columns, justified words were pulled far apart ("Only   in   FIFO"), and the rows touched each other. Table cells are
now ragged right and rows have 25% more space.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ms and every section filled

The pictures were made by the compile test with a stand-in box where a diagram goes, which showed as a half-drawn frame, and
most sections were empty. Each sample is now a note (docs/format-samples/*.lmd) that goes into the built app as a page of its
format and comes out through Download PDF (scripts/format-samples.mjs), with the diagram, table, math or chart the format is
for. A test checks that every sample fills every section of its format.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@triggeredcode
triggeredcode merged commit 1e8da1c into main Oct 12, 2026
4 checks passed
@triggeredcode
triggeredcode deleted the fix-format-samples branch October 12, 2026 15:40
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.

1 participant