summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-20 16:19:25 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-20 16:19:25 +0200
commit87b155b913cea7f5c55b5a2391aff7819ba541a6 (patch)
tree616df0de0f9fa8a08f6fd4156fa5fdac8fb9a1c3 /lib
parent263d0d889073d214229aef9655d3db29540c0d12 (diff)
downloadcolitur-87b155b913cea7f5c55b5a2391aff7819ba541a6.tar.gz
colitur-87b155b913cea7f5c55b5a2391aff7819ba541a6.zip
feat(config): sigla_style, sigla_book and sigla_tradition
Same flag > config > default precedence as --lang, and each reported by config --show with its source, so an override is visible rather than mysterious. A language file's [sigla] section IS a style; a config key SELECTS one and may override settings within it -- the two are not a duplicate setting.
Diffstat (limited to 'lib')
-rw-r--r--lib/naming/config.ml13
-rw-r--r--lib/naming/config.mli24
2 files changed, 35 insertions, 2 deletions
diff --git a/lib/naming/config.ml b/lib/naming/config.ml
index 7d87d62..068b40a 100644
--- a/lib/naming/config.ml
+++ b/lib/naming/config.ml
@@ -5,18 +5,24 @@ type t = {
overlays : string list;
template : string option;
format : string option;
+ sigla_style : string option;
+ sigla_book : string option;
+ sigla_tradition : string option;
unknown_keys : string list;
unknown_sections : string list;
}
let empty =
- { lang = None; overlays = []; template = None; format = None; unknown_keys = [];
- unknown_sections = [] }
+ { lang = None; overlays = []; template = None; format = None; sigla_style = None;
+ sigla_book = None; sigla_tradition = None; unknown_keys = []; unknown_sections = [] }
let lang t = t.lang
let overlays t = t.overlays
let template t = t.template
let format t = t.format
+let sigla_style t = t.sigla_style
+let sigla_book t = t.sigla_book
+let sigla_tradition t = t.sigla_tradition
let unknown_keys t = t.unknown_keys
let unknown_sections t = t.unknown_sections
@@ -65,6 +71,9 @@ let of_string text =
| "lang" -> { acc with lang = Some v }
| "template" -> { acc with template = Some v }
| "format" -> { acc with format = Some v }
+ | "sigla_style" -> { acc with sigla_style = Some v }
+ | "sigla_book" -> { acc with sigla_book = Some v }
+ | "sigla_tradition" -> { acc with sigla_tradition = Some v }
(* accumulates: a user has more than one overlay *)
| "overlay" -> { acc with overlays = v :: acc.overlays }
| other -> { acc with unknown_keys = other :: acc.unknown_keys })
diff --git a/lib/naming/config.mli b/lib/naming/config.mli
index a84f95b..a5205c4 100644
--- a/lib/naming/config.mli
+++ b/lib/naming/config.mli
@@ -29,6 +29,30 @@ val overlays : t -> string list
val template : t -> string option
val format : t -> string option
+(** Which citation style to render a reference in: a language CODE, looked
+ up the same way {!lang} is, or a path -- but a DIFFERENT axis from
+ {!lang}: a language file's own [\[sigla\]] section IS a style
+ ({!Colitur_citation.Render.style_of_fields}), and this key SELECTS
+ which file's [\[sigla\]] section supplies it, independently of which
+ file's other sections supply names elsewhere (a booklet may want
+ Polish names but Latin-convention citations). Same last-wins duplicate
+ policy as {!lang}. *)
+val sigla_style : t -> string option
+
+(** [full] or [abbr] -- overrides the style's own [book] setting rather than
+ replacing the style outright, so a chosen style's punctuation survives
+ even when the book form is overridden ({!Colitur_citation.Render.with_book}).
+ Same last-wins duplicate policy as {!lang}. *)
+val sigla_book : t -> string option
+
+(** The name of a section in [lang/traditions.ini] -- which BOOK a reference
+ DENOTES (Vulgate numbering by default), a different question again from
+ both {!sigla_style} (how a reference is WRITTEN) and {!lang} (what
+ everything else is CALLED): naming and numbering both vary by
+ convention, but not together. Same last-wins duplicate policy as
+ {!lang}. *)
+val sigla_tradition : t -> string option
+
(** Keys present in the [\[defaults\]] section that this build does not
understand. Reported, never fatal: a config written for a newer colitur
must still work on an older one, but silently ignoring a line the user