From 6aebb3ec513c0177a39c2eb8d4b741e90d6f53f4 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Thu, 20 Aug 2026 10:07:15 +0200 Subject: feat(templates): ordo booklet and wall calendar in Typst Adds templates/ef/ordo.typ (A5, one week per page, each day framed with a colour swatch, real names, every fixed string through term.*) and templates/ef/grid.typ (A4 landscape, one month per page, 7 columns, colour-filled cells, Epistle/Gospel sigla), matching what ordo.tex and grid.tex already do. Typst resolves its own table of contents inside a single compile: no pageref/aux-file dance, unlike pdflatex's own two-pass need for ordo.tex. ordo.typ's TOC is one flat heading per week (Month . Week N) rather than ordo.tex's own month-once/weeks-nested layout, since the view model has no first-of-month flag for a template to test and inventing one would be new engine state for a cosmetic grouping. grid.typ deliberately diverges from grid.tex's own partial-fill behaviour for a 5-week month: Typst's row-size list repeats its own last entry for every remaining row, so a two-entry rows spec fills the page completely regardless of week count, where LaTeX's fixed cellh leaves a 5-week month's bottom sixth blank on purpose. Both divergences are documented in the templates' own headers. Two bugs found and fixed while building these against the real typst 0.14.2 binary: two stray hash characters in grid.typ's header comment that were not actually inside a line-comment (would have been parsed as Typst code, not prose); and two lines merging into one wherever they were separated only by a bare newline (still the same soft-wrapped paragraph in Typst, unlike LaTeX's own explicit paragraph break) -- fixed with a trailing backslash to force a real line break without adding inter-paragraph spacing, verified against a full-year render (zero typst warnings across all 365 days of 2027, in both templates). Goldens (test/golden/ordo-2027.typ, test/golden/grid-2027.typ) were generated through the harness's own View.of_days/Template.render_string path, via a throwaway generator, NOT through the CLI: the CLI's default language table differs from the harness's own English-chained-to-Latin table, confirmed live (diffing CLI output against the harness's own render showed exactly the expected language divergence and nothing else) -- the same trap this project has hit before. make check-templates now typesets both templates with the typst binary, using the same SKIPPED-and-exit-0 shape the pdflatex/groff blocks already use when their own tool is absent, verified in both directions: absent (PATH without typst) skips loudly and exits 0, and a deliberately corrupted template fails the target with a non-zero exit and typst's own error text. --- test/test_render_golden.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/test_render_golden.ml') diff --git a/test/test_render_golden.ml b/test/test_render_golden.ml index 6340109..bca7158 100644 --- a/test/test_render_golden.ml +++ b/test/test_render_golden.ml @@ -34,8 +34,8 @@ let check_golden name = Alcotest.(check string) name want got let cases = - [ "ordo.tex"; "ordo.ms"; "ordo.html"; "ordo.adoc"; "ordo.md"; "ordo.txt"; - "grid.tex"; "grid.ms"; "grid.html" ] + [ "ordo.tex"; "ordo.ms"; "ordo.html"; "ordo.adoc"; "ordo.md"; "ordo.txt"; "ordo.typ"; + "grid.tex"; "grid.ms"; "grid.html"; "grid.typ" ] let suite = ( "Render/golden", -- cgit v1.3