diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-20 19:05:13 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-20 19:05:13 +0200 |
| commit | 7dbd16cdf5880c0006dffacd09214ee607050b64 (patch) | |
| tree | 01e1ee37a2be97a0b06fad70de975d8007beb702 /lib/naming/lang.mli | |
| parent | 1aeca948c2a2a82bffaaec65077140aa05f7b3f4 (diff) | |
| parent | 1da70dc7ac03fe33fb92b172a0e26932764170d6 (diff) | |
| download | colitur-7dbd16cdf5880c0006dffacd09214ee607050b64.tar.gz colitur-7dbd16cdf5880c0006dffacd09214ee607050b64.zip | |
Merge branch 'citations-and-sigla'
Citations are parsed into structure and re-rendered, so book names,
abbreviations, punctuation style and numbering tradition become files a
user edits rather than strings frozen in the data.
New lib/citation (Book, Parse, Render, Sigla); [bible] and [sigla]
sections in language files; lang/traditions.ini for numbering; three
config keys and CLI flags. --raw emits every citation byte-for-byte as
stored, bypassing the whole pipeline, so output stays diffable against
lectio and the raw view does not depend on the parser being correct.
Diffstat (limited to 'lib/naming/lang.mli')
| -rw-r--r-- | lib/naming/lang.mli | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/lib/naming/lang.mli b/lib/naming/lang.mli index 34a6d5d..3c62d26 100644 --- a/lib/naming/lang.mli +++ b/lib/naming/lang.mli @@ -55,6 +55,13 @@ val term : t -> string -> string degradation an unnamed slug already gets, not a special case. *) val rite : t -> string -> string +(** A Bible book's name, from the [\[bible\]] section. The key is + [<book_id>.full] or [<book_id>.abbr] (e.g. ["luke.abbr"]). A miss returns + the key itself, the same TOTAL-lookup contract as every other function + here -- callers turn that into a real fallback via + {!Colitur_citation.Book.default_spelling}, not this module. *) +val bible : t -> string -> string + (** [weekday t n], 0 = Sunday. Out-of-range [n] returns [string_of_int n]. *) val weekday : t -> int -> string @@ -69,5 +76,23 @@ val month : t -> int -> string val month_abbr : t -> int -> string (** Every (section-qualified key, value) pair, sorted. Used by [lang --dump] and - [lang --check]. Keys are qualified as e.g. ["celebration.ef-epiphany"]. *) + [lang --check]. Keys are qualified as e.g. ["celebration.ef-epiphany"]. + + Includes [\[bible\]] (["bible.luke.abbr"]): book names are translatable + text, so a file missing them is genuinely incomplete and [lang --check] + should say so. Deliberately EXCLUDES [\[sigla\]]: those are five citation- + style settings with working defaults ({!Colitur_citation.Render.default_style}), + not names a translator owes -- listing them here would make [--check] + demand five settings from every language file. *) val keys : t -> (string * string) list + +(** The [\[sigla\]] section's raw fields, for + {!Colitur_citation.Render.style_of_fields} to read. Values come back + TRIMMED (whitespace at both ends) but still QUOTED if the file quoted + them -- unquoting is [Render]'s job, not this module's, the same reason + {!Colitur_kernel.Overlay_ini} (which this parses through) never unquotes + either. An empty (or absent) [\[sigla\]] section returns [[]]; unlike + every lookup above, there is no per-key TOTAL contract to keep here -- + this is a settings bag, not a translation table, and [Render] already + supplies its own defaults for whatever is missing. *) +val sigla_fields : t -> (string * string) list |
