aboutsummaryrefslogtreecommitdiff
path: root/templates/ef/grid.ms
blob: 727143b4c466066ca79bdee3f1c7e922e6d97a3f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
.\" colitur wall calendar -- groff ms with tbl. flavour: groff
.\" Build: colitur table --year 2027 --template grid.ms | groff -ms -t -Tpdf -P-pa4l > grid.pdf
.\"
.\" LANDSCAPE, not the ms default portrait: with allbox cells and Latin-less
.\" days falling back to the raw slug (some fallback slugs run past 40
.\" characters, e.g. "commemoration-of-the-baptism-of-the-lord"), seven
.\" columns of real content do not fit a portrait line length at any
.\" reasonable point size. "-P-pa4l" is gropdf's own landscape papersize
.\" (groff_font(5): a trailing "l" on a papersize name swaps width/height at
.\" the OUTPUT DEVICE level) -- it must be a command-line flag, not a request
.\" inside this file: an in-document "\X'papersize=a4l'" escape was tried and
.\" rejected (it does not actually rotate gropdf's page in this groff, and
.\" throws diagnostics doing it). ".pl"/".po"/".ll" below independently widen
.\" TROFF's OWN idea of the page to match -- ".pl"/".ll" are requests, unlike
.\" the device's own physical page size, and are not implied by "-P-pa4l" --
.\" so both halves are needed, or one side clips the other.
.\"
.\" ".TL" (the ms title macro, s.tmac) ITSELF narrows the line length to
.\" 5/6 of register "LL" for the title text, and never widens it back
.\" afterward -- there is no third place in s.tmac that ever does. Setting
.\" only the primitive ".ll" before ".TL" is therefore not enough: ".TL"
.\" overwrites it and every table for the rest of the document inherits
.\" the NARROWED value, silently, which is a second, independent way the
.\" original template lost its width (found by reading s.tmac itself, not
.\" guessed). Fixed by setting register "LL" (what ".TL" actually reads)
.\" and re-asserting ".ll" once more, explicitly, right after the title.
.\"
.\" Every column is a FIXED-WIDTH, WRAPPING tbl "w()" block, not a plain "l":
.\" without "w()" tbl sizes a column to its single widest entry and does NOT
.\" wrap, so a 40-character slug forces every column that wide -- seven of
.\" them together run far past any line length, tbl warns "table wider than
.\" line length", and whatever falls past the physical page edge is not a
.\" rendering nicety missing, it is GONE: `pdftotext -layout` (and a printed
.\" page) show only however many columns fit, not all seven. "w()" makes
.\" each column wrap its own text block instead, the same fix grid.tex
.\" already uses via LaTeX's "p{2.6cm}" (see that file's own comment) --
.\" this is the tbl-native equivalent, not a different design.
.\"
.\" "w()" alone is NOT sufficient, and this is the part that actually cost
.\" the time: tbl only wraps a cell as a text block when its content is
.\" delimited by "T{"/"T}" on their own lines. A PLAIN cell entry in a
.\" "w()" column (what the first attempt at this fix used) is never
.\" wrapped at all -- tbl just widens the column past the requested "w()"
.\" to fit the single longest unbroken entry, exactly reproducing the
.\" original bug. Confirmed directly against tbl's own generated troff
.\" code (`tbl grid.ms`, grep "3w0 .*>?"): every column width register is
.\" `max(w(), \w'cell text')`, so an un-delimited 40-character cell always
.\" wins that max. Every day cell below is therefore its own "T{"/"T}"
.\" block; the closing "T}" and the following column's opening "T{" share
.\" one line with the tab between them (the standard tbl idiom: "T}<TAB>
.\" T{"). The template writes that as "{{#last}}T}{{/last}}{{^last}}T}
.\" <TAB>{{/last}}" rather than "T}{{^last}}<TAB>{{/last}}T{" so that no
.\" literal "T{" ever sits directly against a "{{"/"}}" delimiter in the
.\" source -- three braces in a row there parses as a malformed tag, not
.\" as literal text followed by a tag.
.\"
.\" ".na" (no-adjust, ragged right) is required alongside the wrap, not
.\" cosmetic: a hyphenated slug like "commemoration-of-the-baptism-of-the-
.\" lord" DOES break at its own hyphens once wrapping is active (verified:
.\" troff's filler treats an ASCII hyphen as a break point), but adjusted
.\" (justified) fill in a column this narrow cannot always stretch such a
.\" line to the full measure and troff warns "cannot adjust line" for
.\" every such row -- another warning `make check-templates` must fail on.
.\" Ragged-right removes the stretching, not the wrapping.
.\"
.\" The observed day's own display name is a PLAIN resolved string
.\" (View.of_days, Task 5), not a lang-keyed object -- there is no
.\" dotted-la-with-slug-fallback idiom to write here any more (see
.\" ordo.ms's own header comment for the full reasoning).
.\"
.\" The weekday header row comes from the view's own top-level
.\" weekday_headings list (name/last objects), not a hard-coded Dom/Lun/Mar
.\" row -- the same localisation reasoning as grid.tex's own header
.\" comment, and the same reason it cannot be a bare current-value
.\" reference: this engine rejects an empty tag path as a parse error, so a
.\" loop over this list must name a field on each heading object.
.\"
.\" Every cell also carries a last flag, true on the seventh of its row: tbl
.\" needs the tab separator BETWEEN columns, not after the last one, and the
.\" engine has no unless-last construct, so the flag comes from data.
.\"
.\" Sigla: each cell also carries the day's Epistle and Gospel references
.\" (view fields first/gospel), on their own .br line below the day/name
.\" line and joined by \(bu rather than repeated Ep./Ev. labels -- the
.\" same compact choice grid.tex makes, and the same separator glyph
.\" ordo.ms already uses elsewhere in this template family. tbl's own
.\" w() wrap (see above) takes care of a citation too long for the 1.3i
.\" column; no template-side line-splitting is needed here the way
.\" grid.tex needed one for its own fixed-height parbox. Both first and
.\" gospel are wrapped in their own conditional section (mirroring
.\" ordo.ms's own idiom) so a day missing either -- none does in the
.\" shipped EF lectionary, but nothing guarantees a future rite or
.\" overlay keeps that invariant -- prints no stray separator.
.pl 8.27i
.po 0.3i
.nr LL 10.9i
.ll \n[LL]u
.TL
Calendarium {{year}} \(bu {{rite}}
.ll \n[LL]u
.na
{{#months}}
.SH
{{name}}
.TS
allbox;
cw(1.3i) cw(1.3i) cw(1.3i) cw(1.3i) cw(1.3i) cw(1.3i) cw(1.3i)
lw(1.3i) lw(1.3i) lw(1.3i) lw(1.3i) lw(1.3i) lw(1.3i) lw(1.3i).
{{#weekday_headings}}{{name}}{{^last}}	{{/last}}{{/weekday_headings}}
{{#weeks}}{{#days}}T{
{{#in_month}}\fB{{dom}}\fP \s-2{{name}}\s+2
.br
\s-2{{#first}}{{first}}{{/first}}{{#gospel}}{{#first}} \(bu {{/first}}{{gospel}}{{/gospel}}\s+2{{/in_month}}
{{#last}}T}{{/last}}{{^last}}T}	{{/last}}{{/days}}
{{/weeks}}.TE
{{/months}}