summaryrefslogtreecommitdiff
path: root/lib/render/emit_xml.ml
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-19 23:48:35 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-19 23:48:35 +0200
commitecadd969e1d96918820a1fdac0cf0d520d96ba06 (patch)
treea06ed1160bfd28ae4578d9445242e48ac9ac3ea4 /lib/render/emit_xml.ml
parent6762ce46af3cb12bc6ae37cda762c5d95add7903 (diff)
parent329d07b49e397cb65ab52e7ca019b47313027136 (diff)
downloadcolitur-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_xml.ml')
-rw-r--r--lib/render/emit_xml.ml17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/render/emit_xml.ml b/lib/render/emit_xml.ml
index 4e4b51a..3f1ca32 100644
--- a/lib/render/emit_xml.ml
+++ b/lib/render/emit_xml.ml
@@ -11,20 +11,19 @@ let el b name value =
let day b d =
Buffer.add_string b (" <day date=\"" ^ escape (s d "iso") ^ "\">\n");
el b "season" (s d "season");
+ el b "season_name" (s d "season_name");
el b "week" (s d "week");
el b "slug" (s d "slug");
+ (* The resolved display name. A single element, no [lang] attribute: the
+ view's own [name] is now one resolved string, not a lang-keyed object
+ (view.ml), so there is exactly one to emit rather than one per language. *)
+ el b "name" (s d "name");
+ el b "weekday" (s d "weekday");
el b "rank" (s d "rank");
+ el b "rank_name" (s d "rank_name");
el b "colour" (s d "colour");
+ el b "colour_name" (s d "colour_name");
el b "subject" (s d "subject");
- (match get d "name" with
- | Some (T.Obj kvs) ->
- List.iter
- (fun (lang, v) ->
- match v with
- | T.Str x -> Buffer.add_string b (" <name lang=\"" ^ escape lang ^ "\">" ^ escape x ^ "</name>\n")
- | _ -> ())
- kvs
- | _ -> ());
(match get d "comms" with
| Some (T.List l) ->
List.iter (fun c -> Buffer.add_string b (" <commemoration>" ^ escape (s c "slug") ^ "</commemoration>\n")) l