From c00bf135defe69eb303f4bcf32ae862f65c01178 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Thu, 20 Aug 2026 11:09:18 +0200 Subject: feat(templates): the ordo booklet flows continuously, not one week per page One week per page filled roughly the top third of every A5 page and cost 65 pages for a year that needed far fewer -- the original requirement, reversed here: a full 7-day week already occupies most of an A5 page even at reduced type, so the real saving was always in the year's many SHORT boundary weeks (a month's first/last week is rarely a full seven days), not in packing two full weeks together. lib/render/view.ml gains a [first] field on every week object (true on a month's own first week, the same 'cheap flag beats invented template logic' call [last] already made for grid rows) -- there is still no {{../}} parent-path syntax for a template to test this any other way. ordo.tex: the per-week \clearpage is gone. Every week keeps its existing small header line; the month's own first week additionally prints a large, ruled banner. \needspace (a template-local LaTeX dependency, not one of the frozen OCaml deps) keeps a header from being stranded alone at a page's bottom -- and a real, separate bug surfaced building it: \label placed BEFORE \needspace captured the OLD page number when \needspace went on to force a break, producing a step-stale \pageref in the TOC (fixed by moving \label after both needspace checks). The day box itself is tightened (rank/colour folded onto the same line as the citations -- an A5 box is far wider than tall, so this fits even Holy Week's longest citations with room to spare) so a second week routinely shares a page with the first. Measured result: 65 -> 53 pages, two pdflatex passes still settle the TOC, zero orphaned headers, zero overfull boxes. ordo.typ: the per-week #pagebreak is gone; #show heading's own block gains sticky:true, Typst's built-in answer to what ordo.tex needs \needspace for. The month banner needed its OWN sticky:true, found live: without it a banner could sit alone at a page's bottom with the entire month pushed to the next page -- not caught by a check for an orphaned HEADING, since the banner is plain markup, not one. Measured result: 65 -> 27 pages (Typst's own page-fill packs tighter than ordo.tex's needspace-driven approach), one compile pass, zero orphans. The five non-paginated flavours (ms/html/md/adoc/txt) never had a forced page break to remove -- they mainly needed the same header treatment for structural consistency: a week-level header nested under each month's existing one, walking months>weeks>days (the week's own padded, in-month-guarded day list) in place of the old months>days flat loop. Verified against groff, asciidoctor and an HTML parser -- zero warnings. Goldens regenerated through the Test_view.view_of path test_render_golden.ml itself uses, not the CLI (whose --lang default would have pinned output the tests never produce). --- test/golden/ordo-2027.html | 73 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) (limited to 'test/golden/ordo-2027.html') diff --git a/test/golden/ordo-2027.html b/test/golden/ordo-2027.html index ce7aa26..66831ee 100644 --- a/test/golden/ordo-2027.html +++ b/test/golden/ordo-2027.html @@ -7,11 +7,21 @@ (Ordo, Epistle, Gospel, Commemoration) comes from the view's term vocabulary rather than being written into this file, so a translated booklet needs no template edit. --> + Ordo 2027

Ordo 2027 · Roman Missal, 1962 typical edition

January

+

Week 1

1The Octave Day of the Nativity
class-1 · white · Epistle Titus 2:11-15 · Gospel Luke 2:21
@@ -32,6 +43,7 @@
class-4 · white · Epistle Titus 3:4-7 · Gospel Luke 2:15-20
+

Week 2

3The Holy Name of Jesus
class-2 · white · Epistle Acts 4:8-12 · Gospel Luke 2:21
@@ -67,6 +79,7 @@
class-4 · white · Epistle Titus 3:4-7 · Gospel Luke 2:15-20
+

Week 3

10The Holy Family
class-2 · white · Epistle Col 3:12-17 · Gospel Luke 2:42-52
@@ -102,6 +115,7 @@
class-3 · red · Epistle 1 Pet 5:1-4; 5:10-11. · Gospel Matt 16:13-19
+

Week 4

172nd Sunday after Epiphany
class-2 · green · Epistle Rom 12:6-16 · Gospel John 2:1-11
@@ -137,6 +151,7 @@
class-3 · white · Epistle Sir 31:8-11 · Gospel Luke 12:35-40
Commemoration St. Emerentiana
+

Week 5

24Septuagesima Sunday
class-2 · violet · Epistle 1 Cor. 9:24-27; 10:1-5 · Gospel Matt 20:1-16
@@ -172,12 +187,14 @@
class-3 · red · Epistle Sir 51:1-8; 51:12 · Gospel Matt 25:1-13.
+

Week 6

31Sexagesima Sunday
class-2 · violet · Epistle 2 Cor. 11:19-33; 12:1-9 · Gospel Luke 8:4-15

February

+

Week 1

1St. Ignatius of Antioch
class-3 · red · Epistle Rom 8:35-39 · Gospel John 12:24-26
@@ -208,6 +225,7 @@
class-3 · white · Epistle Sir 44:16-27; 45:3-20 · Gospel Luke 10:1-9
Commemoration St. Dorothy
+

Week 2

7Quinquagesima Sunday
class-2 · violet · Epistle 1 Cor. 13:1-13 · Gospel Luke 18:31-43
@@ -243,6 +261,7 @@
class-3 · violet · Epistle Isa 58:9-14 · Gospel Mark 6:47-56
+

Week 3

141st Sunday of Lent
class-1 · violet · Epistle 2 Cor. 6:1-10 · Gospel Matt 4:1-11
@@ -278,6 +297,7 @@
class-2 · violet · Epistle 1 Thess. 5:14-23 · Gospel Matt 17:1-9
+

Week 4

212nd Sunday of Lent
class-1 · violet · Epistle 1 Thess. 4:1-7 · Gospel Matt 17:1-9
@@ -313,12 +333,14 @@
class-3 · violet · Epistle Gen 27:6-40 · Gospel Luke 15:11-32
Commemoration St. Gabriel of Our Lady of Sorrows
+

Week 5

283rd Sunday of Lent
class-1 · violet · Epistle Eph 5:1-9 · Gospel Luke 11:14-28

March

+

Week 1

1Monday of the 3rd Week of Lent
class-3 · violet · Epistle 4 Kings 5:1-15 · Gospel Luke 4:23-30
@@ -349,6 +371,7 @@
class-3 · violet · Epistle Dan 13:1-9, 15-17, 19-30, 33-62. · Gospel John 8:1-11
Commemoration Sts. Felicitas & Perpetua
+

Week 2

74th Sunday of Lent
class-1 · rose · Epistle Gal 4:22-31 · Gospel John 6:1-15
@@ -384,6 +407,7 @@
class-3 · violet · Epistle Isa 49:8-15 · Gospel John 8:12-20
+

Week 3

14Passion Sunday
class-1 · violet · Epistle Heb 9:11-15. · Gospel John 8:46-59.
@@ -419,6 +443,7 @@
class-3 · violet · Epistle Jer 18:18-23 · Gospel John 12:10-36
+

Week 4

21Palm Sunday
class-1 · violet · Epistle Phil 2:5-11 · Gospel Matt. 26:36-75; 27:1-60.
@@ -454,6 +479,7 @@
class-1 · violet · Epistle Col 3:1-4 · Gospel Matt 28:1-7
+

Week 5

28Easter Sunday
class-1 · white · Epistle 1 Cor 5:7-8 · Gospel Mark 16:1-7
@@ -475,6 +501,7 @@

April

+

Week 1

1Thursday of Easter Week
class-1 · white · Epistle Acts 8:26-40 · Gospel John 20:11-18
@@ -490,6 +517,7 @@
class-1 · white · Epistle 1 Pet 2:1-10 · Gospel John 20:1-9
+

Week 2

4Low Sunday (Sunday in Easter Octave)
class-1 · white · Epistle 1 John 5:4-10 · Gospel John 20:19-31
@@ -525,6 +553,7 @@
class-4 · white · Epistle Ecclus 24:14-16 · Gospel John 19:25-27
+

Week 3

112nd Sunday after Easter
class-2 · white · Epistle 1 Pet 2:21-25 · Gospel John 10:11-16
@@ -560,6 +589,7 @@
class-4 · white · Epistle Ecclus 24:14-16 · Gospel John 19:25-27
Commemoration St. Anicetus
+

Week 4

183rd Sunday after Easter
class-2 · white · Epistle 1 Pet 2:11-19 · Gospel John 16:16-22
@@ -595,6 +625,7 @@
class-3 · red · Epistle Wis 5:1-5 · Gospel John 15:1-7
+

Week 5

254th Sunday after Easter
class-2 · white · Epistle Jas 1:17-21 · Gospel John 16:5-14
@@ -626,11 +657,13 @@

May

+

Week 1

1St. Joseph the Workman
class-1 · white · Epistle Col. 3:14-15, 17, 23-24 · Gospel Matt 13:54-58
+

Week 2

25th Sunday after Easter
class-2 · white · Epistle Jas 1:22-27 · Gospel John 16:23-30
@@ -666,6 +699,7 @@
class-4 · white · Epistle Ecclus 24:14-16 · Gospel John 19:25-27
+

Week 3

9Sunday after the Ascension
class-2 · white · Epistle 1 Pet 4:7-11. · Gospel John 15:26-27; 16:1-4.
@@ -701,6 +735,7 @@
class-1 · red · Epistle Acts 19:1-8. · Gospel John 14:15-21.
+

Week 4

16Pentecost Sunday (Whitsunday)
class-1 · red · Epistle Acts 2:1-11. · Gospel John 14:23-31.
@@ -736,6 +771,7 @@
class-1 · red · Epistle Rom 5:1-5. · Gospel Luke 4:38-44.
+

Week 5

23Trinity Sunday
class-1 · white · Epistle Rom 11:33-36. · Gospel Matt 28:18-20
@@ -771,6 +807,7 @@
class-3 · white · Epistle 2 Cor 10:17-18; 11:1-2 · Gospel Matt 25:1-13.
+

Week 6

302nd Sunday after Pentecost
class-2 · green · Epistle 1 John 3:13-18. · Gospel Luke 14:16-24.
@@ -782,6 +819,7 @@
Commemoration St. Petronilla

June

+

Week 1

1St. Angela Merici
class-3 · white · Epistle 2 Cor 10:17-18; 11:1-2 · Gospel Matt 25:1-13.
@@ -807,6 +845,7 @@
class-3 · red · Epistle Ecclus 44:1-15 · Gospel Matt 5:1-12
+

Week 2

63rd Sunday after Pentecost
class-2 · green · Epistle 1 Pet. 5:6-11 · Gospel Luke 15:1-10
@@ -842,6 +881,7 @@
class-3 · white · Epistle Sir 31:8-11 · Gospel Luke 12:35-40
Commemoration St. Basilidus
+

Week 3

134th Sunday after Pentecost
class-2 · green · Epistle Rom 8:18-23 · Gospel Luke 5:1-11
@@ -877,6 +917,7 @@
class-3 · white · Epistle 2 Cor 10:17-18; 11:1-2 · Gospel Matt 25:1-13.
Commemoration Sts. Gervasius and Protasius
+

Week 4

205th Sunday after Pentecost
class-2 · green · Epistle 1 Pet 3:8-15. · Gospel Matt 5:20-24.
@@ -912,6 +953,7 @@
class-3 · red · Epistle Eccli 44:10-15 · Gospel Luke 12:1-8
+

Week 5

276th Sunday after Pentecost
class-2 · green · Epistle Rom 6:3-11. · Gospel Mark 8:1-9
@@ -933,6 +975,7 @@
Commemoration St. Peter

July

+

Week 1

1The Precious Blood of Our Lord Jesus Christ
class-1 · red · Epistle Heb 9:11-15. · Gospel John 19:30-35
@@ -948,6 +991,7 @@
class-3 · red · Epistle 2 Tim. 3:14-17; 4:1-5 · Gospel Matt 10:28-33
+

Week 2

47th Sunday after Pentecost
class-2 · green · Epistle Rom 6:19-23 · Gospel Matt 7:15-21
@@ -983,6 +1027,7 @@
class-3 · red · Epistle Prov 31:10-31 · Gospel Matt 12:46-50
+

Week 3

118th Sunday after Pentecost
class-2 · green · Epistle Rom 8:12-17 · Gospel Luke 16:1-9
@@ -1018,6 +1063,7 @@
class-4 · white · Epistle Ecclus 24:14-16 · Gospel Luke 11:27-28
Commemoration St. Alexis
+

Week 4

189th Sunday after Pentecost
class-2 · green · Epistle 1 Cor. 10:6-13 · Gospel Luke 19:41-47
@@ -1053,6 +1099,7 @@
class-4 · white · Epistle Ecclus 24:14-16 · Gospel Luke 11:27-28
Commemoration St. Christina
+

Week 5

2510th Sunday after Pentecost
class-2 · green · Epistle 1 Cor. 12:2-11 · Gospel Luke 18:9-14
@@ -1089,6 +1136,7 @@

August

+

Week 1

111th Sunday after Pentecost
class-2 · green · Epistle 1 Cor. 15:1-10 · Gospel Mark 7:31-37
@@ -1124,6 +1172,7 @@
class-3 · white · Epistle Sir 31:8-11 · Gospel Matt 6:24-33
Commemoration St. Donatus
+

Week 2

812th Sunday after Pentecost
class-2 · green · Epistle 2 Cor. 3:4-9 · Gospel Luke 10:23-37
@@ -1159,6 +1208,7 @@
class-2 · violet · Epistle Sir 24:23-31 · Gospel Luke 11:27-28
Commemoration St. Eusebius
+

Week 3

15Assumption of the Blessed Virgin Mary
class-1 · white · Epistle Judith 13:22-25; 15:10 · Gospel Luke 1:41-50
@@ -1194,6 +1244,7 @@
class-3 · white · Epistle Prov 31:10-31 · Gospel Matt 13:44-52.
+

Week 4

2214th Sunday after Pentecost
class-2 · green · Epistle Gal 5:16-24 · Gospel Matt 6:24-33
@@ -1229,6 +1280,7 @@
class-3 · white · Epistle 2 Tim 4:1-8 · Gospel Matt 5:13-19
Commemoration St. Hermes
+

Week 5

2915th Sunday after Pentecost
class-2 · green · Epistle Gal 5:25-26; 6:1-10 · Gospel Luke 7:11-16
@@ -1245,6 +1297,7 @@

September

+

Week 1

1Wednesday of the 15th Week of the Time after Pentecost
class-4 · green · Epistle Gal 5:25-26; 6:1-10 · Gospel Luke 7:11-16
@@ -1265,6 +1318,7 @@
class-4 · white · Epistle Ecclus 24:14-16 · Gospel Luke 11:27-28
+

Week 2

516th Sunday after Pentecost
class-2 · green · Epistle Eph 3:13-21 · Gospel Luke 14:1-11
@@ -1300,6 +1354,7 @@
class-4 · white · Epistle Ecclus 24:14-16 · Gospel Luke 11:27-28
Commemoration Sts. Protus & Hyacinth
+

Week 3

1217th Sunday after Pentecost
class-2 · green · Epistle Eph 4:1-6 · Gospel Matt 22:34-46
@@ -1335,6 +1390,7 @@
class-3 · white · Epistle 1 Cor 13:1-8 · Gospel Matt 22:1-14
+

Week 4

1918th Sunday after Pentecost
class-2 · green · Epistle 1 Cor. 1:4-8 · Gospel Matt 9:1-8
@@ -1370,6 +1426,7 @@
class-2 · violet · Epistle Heb 9:2-12 · Gospel Luke 13:6-17
+

Week 5

2619th Sunday after Pentecost
class-2 · green · Epistle Eph 4:23-28 · Gospel Matt 22:1-14
@@ -1396,6 +1453,7 @@

October

+

Week 1

1Friday of the 19th Week of the Time after Pentecost
class-4 · green · Epistle Eph 4:23-28 · Gospel Matt 22:1-14
@@ -1406,6 +1464,7 @@
class-3 · white · Epistle Exod 23:20-23 · Gospel Matt 18:1-10
+

Week 2

320th Sunday after Pentecost
class-2 · green · Epistle Eph 5:15-21 · Gospel John 4:46-53
@@ -1441,6 +1500,7 @@
class-3 · white · Epistle 2 Cor 4:1-6; 4:15-18 · Gospel Luke 10:1-9
Commemoration St. Dionysius and companions
+

Week 3

1021st Sunday after Pentecost
class-2 · green · Epistle Eph 6:10-17 · Gospel Matt 18:23-35
@@ -1476,6 +1536,7 @@
class-3 · white · Epistle Prov 31:10-31 · Gospel Matt 13:44-52.
+

Week 4

1722nd Sunday after Pentecost
class-2 · green · Epistle Phil 1:6-11 · Gospel Matt 22:15-21
@@ -1511,6 +1572,7 @@
class-3 · white · Epistle Heb 7:23-27 · Gospel Matt 24:42-47
+

Week 5

2423rd Sunday after Pentecost
class-2 · green · Epistle Phil 3:17-21; 4:1-3 · Gospel Matt 9:18-26
@@ -1546,12 +1608,14 @@
class-4 · white · Epistle Ecclus 24:14-16 · Gospel Luke 11:27-28
+

Week 6

31Christ the King
class-1 · white · Epistle Col 1:12-20. · Gospel John 18:33-37

November

+

Week 1

1All Saints
class-1 · white · Epistle Apoc 7:2-12 · Gospel Matt 5:1-12
@@ -1582,6 +1646,7 @@
class-4 · white · Epistle Ecclus 24:14-16 · Gospel Luke 11:27-28
+

Week 2

75th Sunday after Epiphany
class-2 · green · Epistle Col 3:12-17 · Gospel Matt 13:24-30
@@ -1617,6 +1682,7 @@
class-3 · white · Epistle 1 Cor 4:9-14 · Gospel Luke 12:32-34
+

Week 3

146th Sunday after Epiphany
class-2 · green · Epistle 1 Thess 1:2-10 · Gospel Matt 13:31-35
@@ -1652,6 +1718,7 @@
class-3 · white · Epistle 1 Cor. 4:9-14 · Gospel Luke 12:32-34
+

Week 4

2124th and Last Sunday after Pentecost
class-2 · green · Epistle Col 1:9-14 · Gospel Matt 24:15-35
@@ -1687,6 +1754,7 @@
class-4 · white · Epistle Ecclus 24:14-16 · Gospel Luke 11:27-28
+

Week 5

281st Sunday of Advent
class-1 · violet · Epistle Rom 13:11-14 · Gospel Luke 21:25-33
@@ -1703,6 +1771,7 @@
Commemoration Tuesday of the 1st Week of Advent

December

+

Week 1

1Wednesday of the 1st Week of Advent
class-3 · violet · Epistle Rom 13:11-14 · Gospel Luke 21:25-33
@@ -1723,6 +1792,7 @@
class-3 · white · Epistle 2 Tim 4:1-8 · Gospel Matt 5:13-19
Commemoration Saturday of the 1st Week of Advent
Commemoration St. Barbara
+

Week 2

52nd Sunday of Advent
class-1 · violet · Epistle Rom 15:4-13 · Gospel Matt 11:2-10
@@ -1758,6 +1828,7 @@
class-3 · white · Epistle 1 Pet 5:1-4; 5:10-11. · Gospel Matt 16:13-19
Commemoration Saturday of the 2nd Week of Advent
+

Week 3

123rd Sunday of Advent
class-1 · rose · Epistle Phil 4:4-7 · Gospel John 1:19-28
@@ -1793,6 +1864,7 @@
class-2 · violet · Epistle 2 Thess 2:1-8 · Gospel Luke 3:1-6
+

Week 4

194th Sunday of Advent
class-1 · violet · Epistle 1 Cor. 4:1-5 · Gospel Luke 3:1-6
@@ -1828,6 +1900,7 @@
class-1 · white · Epistle Heb 1:1-12 · Gospel John 1:1-14
+

Week 5

26Sunday within the Octave of the Nativity
class-2 · white · Epistle Gal 4:1-7 · Gospel Luke 2:33-40
-- cgit v1.3