aboutsummaryrefslogtreecommitdiff
path: root/lib/naming/config.mli
diff options
context:
space:
mode:
Diffstat (limited to 'lib/naming/config.mli')
-rw-r--r--lib/naming/config.mli28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/naming/config.mli b/lib/naming/config.mli
new file mode 100644
index 0000000..41ff429
--- /dev/null
+++ b/lib/naming/config.mli
@@ -0,0 +1,28 @@
+(** The config file: what the user wants by default, and where each value came
+ from.
+
+ Owns precedence and provenance and nothing else. Never reads the filesystem
+ -- callers hand it text -- so it is as testable as the language table.
+
+ A config file is OPTIONAL. With none, colitur behaves exactly as it does
+ without this feature, except that names resolve through the default
+ language. *)
+
+type t
+
+val empty : t
+val of_string : string -> (t, string) result
+
+val lang : t -> string option
+val overlays : t -> string list
+val template : t -> string option
+val format : t -> string option
+
+(** Keys present in the file 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 wrote is how a typo becomes invisible. *)
+val unknown_keys : t -> string list
+
+(** [resolve ~flag ~config ~default] returns [(value, source)] with source one of
+ ["flag"], ["config"], ["default"]. Precedence is flag > config > default. *)
+val resolve : flag:string option -> config:string option -> default:string -> string * string