diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-19 23:48:35 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-19 23:48:35 +0200 |
| commit | ecadd969e1d96918820a1fdac0cf0d520d96ba06 (patch) | |
| tree | a06ed1160bfd28ae4578d9445242e48ac9ac3ea4 /lib/render/emit_csv.ml | |
| parent | 6762ce46af3cb12bc6ae37cda762c5d95add7903 (diff) | |
| parent | 329d07b49e397cb65ab52e7ca019b47313027136 (diff) | |
| download | colitur-ecadd969e1d96918820a1fdac0cf0d520d96ba06.tar.gz colitur-ecadd969e1d96918820a1fdac0cf0d520d96ba06.zip | |
feat: naming, localisation and the rebuilt printed output
colitur computed the calendar correctly and could not say what it had
computed. A printed ordo read ef-septuagesima-sunday-2 where a reader
expects Dominica in Sexagesima, and the wall calendar showed slugs in
every cell.
lib/naming a language table and a config file, both pure and total,
parsing the INI reader Overlay_ini already had
lang/ la.ini and en.ini -- 725 names, every one transcribed
from the 1962 Missal and citing the line it came from
templates the ordo rebuilt as an A5 booklet: one week per page, a
table of contents, framed days, a colour swatch; the wall
calendar now fills its sheet instead of a quarter of it
tools check_citations.py verifies all 400 citations resolve,
with 33 self-tests of its own
Names resolve through lang -> declared fallback -> the slug, so a partial
translation is usable from its first line and the fully degraded case is
the old output rather than a blank page.
colitur day and colitur readings are BYTE-IDENTICAL to before, verified
against main rather than asserted; --lang, --raw and the lang/config
subcommands are still to come, and man/colitur-templates.5 still
documents the pre-naming view, so writing a custom template needs the
source until that lands.
Diffstat (limited to 'lib/render/emit_csv.ml')
| -rw-r--r-- | lib/render/emit_csv.ml | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/render/emit_csv.ml b/lib/render/emit_csv.ml index b478265..415a684 100644 --- a/lib/render/emit_csv.ml +++ b/lib/render/emit_csv.ml @@ -16,11 +16,15 @@ let escape_field s = let get v k = match v with T.Obj kvs -> List.assoc_opt k kvs | _ -> None let s v k = match get v k with Some (T.Str x) -> x | _ -> "" -let nested v a b = match get v a with Some inner -> s inner b | None -> "" +(* [name] is now the single RESOLVED display string (view.ml), not a + lang-keyed object -- the [name_la]/[name_en] pair this replaces carried + the kernel's own [Celebration.names], a different, unlocalised source. + Machine formats still carry [slug] alongside it, so a script keeps the + stable key and a human reads the name. *) let columns = - [ "date"; "rite"; "season"; "week"; "slug"; "rank"; "colour"; "subject"; - "name_la"; "name_en"; "first"; "gospel"; "comms" ] + [ "date"; "rite"; "season"; "season_name"; "week"; "slug"; "name"; "weekday"; + "rank"; "rank_name"; "colour"; "colour_name"; "subject"; "first"; "gospel"; "comms" ] let row ~rite d = let comms = @@ -30,9 +34,9 @@ let row ~rite d = in String.concat "," (List.map escape_field - [ s d "iso"; rite; s d "season"; s d "week"; s d "slug"; s d "rank"; - s d "colour"; s d "subject"; nested d "name" "la"; nested d "name" "en"; - s d "first"; s d "gospel"; comms ]) + [ s d "iso"; rite; s d "season"; s d "season_name"; s d "week"; s d "slug"; + s d "name"; s d "weekday"; s d "rank"; s d "rank_name"; s d "colour"; + s d "colour_name"; s d "subject"; s d "first"; s d "gospel"; comms ]) let year v = let rite = s v "rite" in |
