aboutsummaryrefslogtreecommitdiff
path: root/templates/ef/grid.html
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-19 09:59:47 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-19 09:59:47 +0200
commit24de019a3e1d5b9a6d4601bdd65489813baa7e58 (patch)
tree04a0d3b5c9f8c3095820dd8bae8b0d67932b4e37 /templates/ef/grid.html
parent6bd741bd512904dfec7c1aa2b7b2bd3dd4269681 (diff)
downloadcolitur-24de019a3e1d5b9a6d4601bdd65489813baa7e58.tar.gz
colitur-24de019a3e1d5b9a6d4601bdd65489813baa7e58.zip
feat(templates): wall calendar grid in LaTeX, groff and HTML
Three flavours, not six: a month grid in Markdown or plain text is a worse artefact than the booklet already is, and shipping a template we would not use ourselves is maintenance with no reader. These are the first templates to use weeks and in_month, so this is where the view model earns its keep -- the booklet and the grid come from one model with no second code path. Every cell carries a per-cell 'last' boolean (already in the view). A table row needs a separator BETWEEN cells and the engine deliberately has no 'unless last' construct; the rule is shape the data, not the template. Without it the LaTeX grid emits eight columns for seven cells and pdflatex rejects the file. Day cells resolve their label as {{#name}}{{la}}{{^la}}{{slug}}{{/la}} {{/name}}, never a bare {{name.la}}: the enclosing month object has its own name.la, and the engine's scope lookup falls back outward, so a bare dotted lookup would render the month's own Latin name on every day lacking one -- a wall calendar where every day reads "January". Verified on the goldens: Ianuarius appears exactly once per file, the month heading, never as a day label.
Diffstat (limited to 'templates/ef/grid.html')
-rw-r--r--templates/ef/grid.html35
1 files changed, 35 insertions, 0 deletions
diff --git a/templates/ef/grid.html b/templates/ef/grid.html
new file mode 100644
index 0000000..b92e14a
--- /dev/null
+++ b/templates/ef/grid.html
@@ -0,0 +1,35 @@
+<!-- colitur wall calendar -- HTML. flavour: html -->
+<!-- Day label falls back to the slug when the day carries no Latin name
+ (most temporal days, and most sanctoral entries, which are Latin-less
+ in the shipped data) -- see ordo.tex's own comment for why the fallback
+ is written as a name-section wrapping a plain var and its inverse,
+ rather than a single dotted lookup and its inverse: the enclosing month
+ object also carries its own name.la, and a dotted lookup that misses
+ climbs the WHOLE path to that outer scope instead of falling back. -->
+<!doctype html>
+<html lang="la"><head><meta charset="utf-8">
+<title>Calendarium {{year}}</title>
+<style>
+ body{font-family:sans-serif;margin:1em}
+ table{border-collapse:collapse;width:100%;margin-bottom:1.5em;page-break-inside:avoid}
+ caption{font-size:1.2em;font-weight:bold;padding:.4em}
+ th{font-size:.8em;padding:.2em;border-bottom:1px solid #999}
+ td{border:1px solid #ddd;vertical-align:top;height:5em;width:14.28%;padding:.2em;font-size:.75em}
+ td.pad{background:#fafafa;border-color:#eee}
+ .dom{font-weight:bold;display:block}
+ .white{background:#fff} .red{background:#fdd} .green{background:#dfd}
+ .violet{background:#eae} .rose{background:#fde} .black{background:#ddd}
+ @media print{@page{size:landscape}body{margin:0}}
+</style></head><body>
+<h1>Calendarium {{year}} &middot; {{rite}}</h1>
+{{#months}}
+<table>
+ <caption>{{name.la}}</caption>
+ <tr><th>Dom</th><th>Lun</th><th>Mar</th><th>Mer</th><th>Iov</th><th>Ven</th><th>Sab</th></tr>
+ {{#weeks}}<tr>
+ {{#days}}{{#in_month}}<td class="{{colour}}"><span class="dom">{{dom}}</span>{{#name}}{{la}}{{^la}}{{slug}}{{/la}}{{/name}}</td>{{/in_month}}{{^in_month}}<td class="pad"></td>{{/in_month}}{{/days}}
+ </tr>
+ {{/weeks}}
+</table>
+{{/months}}
+</body></html>