diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/citation/render.ml | 1 | ||||
| -rw-r--r-- | lib/citation/render.mli | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/citation/render.ml b/lib/citation/render.ml index c66a0ca..79aaa86 100644 --- a/lib/citation/render.ml +++ b/lib/citation/render.ml @@ -20,6 +20,7 @@ let default_style = let part_sep st = st.part_sep let range st = st.range let book_sep st = st.book_sep +let book_string st = match st.book with `Full -> "full" | `Abbr -> "abbr" (* Arabic -> Roman, for the {chapter_roman} placeholder. Lifted from [Colitur_render.View.roman_numeral], which prints "Hebdomada I" week diff --git a/lib/citation/render.mli b/lib/citation/render.mli index d741931..274900c 100644 --- a/lib/citation/render.mli +++ b/lib/citation/render.mli @@ -44,5 +44,15 @@ val range : style -> string [\textasciitilde{}]. *) val book_sep : style -> string +(** The style's own book form, as the string a config file would write + (["full"] or ["abbr"]). + + Exists so a caller can use the STYLE's value as the default when + resolving the [sigla_book] setting. Resolving against a hardcoded + ["abbr"] instead makes a style file's own [book] key unreachable -- + the value is always overwritten before it can apply -- which is what + shipped until this accessor existed. *) +val book_string : style -> string + val render : style -> names:(Book.id -> [ `Full | `Abbr ] -> string) -> Parse.t -> string |
