aboutsummaryrefslogtreecommitdiff
path: root/templates/ef/ordo.html
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-20 11:09:18 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-20 11:09:18 +0200
commitc00bf135defe69eb303f4bcf32ae862f65c01178 (patch)
treefea8a088c40e366bc902d991ddf826d2b9b81a0d /templates/ef/ordo.html
parent1935f40c156563c134f87093bf6ec8da1cf4fc46 (diff)
downloadcolitur-c00bf135defe69eb303f4bcf32ae862f65c01178.tar.gz
colitur-c00bf135defe69eb303f4bcf32ae862f65c01178.zip
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).
Diffstat (limited to 'templates/ef/ordo.html')
-rw-r--r--templates/ef/ordo.html15
1 files changed, 13 insertions, 2 deletions
diff --git a/templates/ef/ordo.html b/templates/ef/ordo.html
index c80a2a4..4936974 100644
--- a/templates/ef/ordo.html
+++ b/templates/ef/ordo.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. -->
+<!-- Defect 2: HTML has no concept of a forced page break to begin with,
+ so this flavour was never one-week-per-page -- it mainly needed the
+ SAME header treatment the paginated flavours gained, for a reader
+ switching between them to find the same structure. Walks
+ months>weeks>days now (was months>days flat): an h2 per month
+ (unchanged) and a new h3 per week, using the week's own padded,
+ in-month-flagged day list rather than the month's flat, unpadded
+ one -- guarded accordingly below, the same guard every paginated
+ flavour's grid already needs for that field. -->
<!doctype html>
<html lang="la"><head><meta charset="utf-8">
<title>{{term.ordo}} {{year}}</title>
<style>
body{font-family:serif;max-width:40em;margin:2em auto;line-height:1.4}
+ h3{font-size:1em;border-top:1px solid #ccc;padding-top:.3em;margin-top:1.2em}
.day{margin:.6em 0;padding-left:2.5em;text-indent:-2.5em}
.dom{display:inline-block;width:2em;font-weight:bold}
.meta{font-size:.85em;color:#555}
@@ -22,10 +32,11 @@
</style></head><body>
<h1>{{term.ordo}} {{year}} &middot; {{rite_name}}</h1>
{{#months}}<h2>{{name}}</h2>
-{{#days}}<div class="day {{colour}}">
+{{#weeks}}<h3>{{term.week}} {{num}}</h3>
+{{#days}}{{#in_month}}<div class="day {{colour}}">
<span class="dom">{{dom}}</span>{{name}}
<div class="meta">{{rank}} &middot; {{colour}}{{#first}} &middot; {{term.epistle}} {{first}}{{/first}}{{#gospel}} &middot; {{term.gospel}} {{gospel}}{{/gospel}}</div>
{{#comms}}<div class="meta">{{term.commemoration}} {{name}}</div>{{/comms}}
</div>
-{{/days}}{{/months}}
+{{/in_month}}{{/days}}{{/weeks}}{{/months}}
</body></html>