aboutsummaryrefslogtreecommitdiff
path: root/man/colitur-config.5
blob: 15ca92bee1cfa72edddc3d732be1549d9a802d67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
.TH COLITUR\-CONFIG 5 "2026" "colitur" "File Formats"
.SH NAME
colitur\-config \- default settings file for colitur(1)
.SH SYNOPSIS
.I ~/.config/colitur/config.ini
.SH DESCRIPTION
A
.B colitur
config file supplies DEFAULTS for four settings \(em
.IR lang ", " overlay ", " template " and " format
\(em so a command line does not have to repeat
.B \-\-lang
.IR en ,
.B \-\-overlay
.I ~/calendars/diocese.sexp
or
.B \-\-template
.I booklet.tex
on every invocation.
.PP
A config file is entirely
.BR OPTIONAL .
With none present, every command behaves exactly as it does without this
feature, except that display names still resolve through the built\-in
default language
.RI ( la ).
.SH LOCATION
.RS
.nf
$XDG_CONFIG_HOME/colitur/config.ini   if $XDG_CONFIG_HOME is set and non\-blank
$HOME/.config/colitur/config.ini      otherwise
.fi
.RE
.PP
If neither variable is usable (no
.BR HOME ),
there is no config path at all, and colitur behaves exactly as if no config
file existed \(em this is not an error.
.SH PRECEDENCE
For every one of the four settings, in order:
.RS
.nf
1. the command\-line flag        (\-\-lang, \-\-overlay, \-\-template, \-\-format)
2. the config file's own value
3. the built\-in default
.fi
.RE
.PP
.BR "colitur config \-\-show" ,
described below, reports EXACTLY this resolution for the flags given on
that same command line \(em it is not a separate calculation that could
disagree with what a real command actually does; both go through the same
resolver.
.PP
.IR lang ", " template " and " format
are each a single scalar value: config supplies one only when the
corresponding flag is
.B entirely absent
from the command line, never merged or overridden field\-by\-field with a
partial flag value.
.I overlay
is a
.B list
(it is repeatable on the command line, and overlays apply in order, last
writer wins) and follows the identical rule at the list level: config's
.I overlay
lines are used only when
.B zero
.B \-\-overlay
flags were given; a single
.B \-\-overlay
on the command line replaces the config list entirely rather than adding to
it. This keeps the direction of precedence uniform across all four settings
\(em flag beats config beats default \(em rather than inventing a merge
order nothing else in this file documents.
.SH FORMAT
An INI file, read by the same section reader
.BR colitur\-overlay (5)'s
flat INI form and colitur's own language files use: section names in
.RB \(lq [ name ] \(rq ,
.RB \(lq key " = " value \(rq
lines,
.B ;
and
.B #
comments, blank lines ignored. No continuations, no quoting.
.PP
Every setting lives in a section named
.BR defaults .
A section named anything else is
.B unrecognised
\(em including a plain typo such as
.B [deafults]
\(em and is warned about, not silently dropped (see
.B UNKNOWN KEYS AND SECTIONS
below).
.PP
If
.B [defaults]
appears more than once, every occurrence is merged, not only the first: a
hand\-edited config file will naturally grow a second
.B [defaults]
block as a user appends a line later, and only reading the first would
silently ignore it. Within one key, or across two blocks, the
.B LAST
occurrence wins \(em the natural reading of "the bottom line is the one
that took effect" for a file edited by hand over time. A repeated
.B overlay
key is the one exception: it
.B accumulates
(one entry per line), because a user legitimately has more than one local
overlay.
.SH SETTINGS
.TP
.B lang
A language CODE (e.g.
.BR la ", " en )
or a file path, exactly as
.B \-\-lang
accepts it. Default
.BR la .
See
.BR colitur (1)'s
own
.B NAMING
section for how a CODE resolves to a file, and what an unknown language
does (a hard error, on every command, never a silent fallback).
.TP
.B overlay
A local calendar file, applied on top of the shipped universal one, exactly
as
.B \-\-overlay
accepts it. Repeatable \(em one
.B overlay
.B =
line per file, applied in the order they appear in the config file. No
default (an empty list).
.TP
.B template
A template file path, exactly as
.B \-\-template
accepts it. Relevant only to
.BR table " and " render ,
which require a template either from this setting or from
.BR \-\-template ;
no default.
.PP
.B Neither
.I overlay
.B nor
.I template
.B is shell\-expanded.
A value is read as a literal string and handed straight to the filesystem
\(em there is no shell here to turn a leading
.B ~
into
.IR $HOME .
.RS
.nf

$ printf '[defaults]\enoverlay = ~/calendars/diocese.sexp\en' > config.ini
$ XDG_CONFIG_HOME=. colitur day 2026
colitur: failed to load ~/calendars/diocese.sexp: ~/calendars/diocese.sexp: No such file or directory
.fi
.RE
.PP
Write the full path instead
.RI ( $HOME /calendars/diocese.sexp,
which the SHELL expands when the config file is CREATED, e.g. via
.BR "echo \(dqoverlay = $HOME/calendars/diocese.sexp\(dq >> config.ini" ,
not a bare
.BR ~ / ... " written literally into the file)."
.TP
.B format
One of
.BR csv ", " json ", " sexp ", " xml " or " ics ,
exactly as
.B \-\-format
accepts it. Relevant only to
.BR emit ,
which requires a format either from this setting or from
.BR \-\-format ;
no default.
.TP
.B flavour
Which ESCAPING flavour a template's output is written in: one of
.BR latex ", " typst ", " groff ", " html ", " xml ", " ics " or " none ,
exactly as
.B \-\-flavour
accepts it. Relevant to
.BR table " and " render .
.IP
A flavour is the set of characters that must be neutered so a value cannot
corrupt the format it lands in, and every target has different ones: a
citation carrying a semicolon is ordinary text in LaTeX but a FIELD
SEPARATOR in iCalendar, so
.B "Ecclus 51:1\-8; 51:12"
must be written
.B "Ecclus 51:1\-8\e; 51:12"
there or one calendar field silently becomes two. In LaTeX a saint's name containing
.B &
or
.B _
does not merely look wrong \(em it aborts the build.
.IP
Normally there is nothing to set: the flavour is inferred from the
template's own file extension, so
.I ordo.tex
gets
.BR latex " and " ordo.ics " gets " ics .
This setting exists for the template whose extension says nothing. Leaving
it unset therefore means INFER, not "no escaping", which is why
.B colitur config \-\-show
reports it as
.BR (infer) " rather than " (none) .
There is deliberately no silent fallback: when the flavour can neither be
inferred nor found here, colitur refuses rather than guessing, because
guessing wrong yields output that is malformed rather than ugly, and
malformed output is usually silent.
.IP
.B none
is a real choice rather than a failure mode \(em correct when a template
targets plain text and the value should pass through byte for byte.
.TP
.B sigla_style
Which citation STYLE to render book names and punctuation with: a language
code, or a path to a file carrying a
.B [sigla]
section. Defaults to the resolved
.IR lang ,
so a booklet's citations follow its own language unless told otherwise.
See
.BR colitur (1)'s
.B SIGLA
section for the five style settings.
.TP
.B sigla_book
.BR full " or " abbr .
Overrides the selected style's own
.B book
setting. Default
.BR abbr ,
giving
.B "Luc 5:12\-14"
rather than
.BR "Evangelium secundum Lucam 5:12\-14" .
An unrecognised value is a hard error, the same discipline as an unknown
.BR \-\-lang .
.TP
.B sigla_tradition
A section name in
.IR lang/traditions.ini ,
deciding which book a reference DENOTES rather than what it is called.
Default
.BR vulgate ,
the identity \(em colitur never renumbers unless asked. With
.B modern
the Vulgate's own
.B "3 Kings 19:3\-8"
renders as
.B "1 Reg 19:3\-8"
in Latin, or
.B "1 Kgs 19:3\-8"
under
.BR "\-\-lang en" .
In Latin the modern tradition only really moves Kings and Esdras: Osee,
Ionas, Ecclesiasticus and the Apocalypse keep their Vulgate names either
way, because modern numbering is a vernacular convention.
Unlike
.IR sigla_book ,
an unrecognised value is NOT fatal: it warns on stderr and falls back to
.BR vulgate ,
because asking for a renumbering is optional the way asking for a language
is not.
.PP
Naming and renumbering are deliberately separate mechanisms.
.I sigla_style
selects what a book is CALLED, which varies by language;
.I sigla_tradition
selects which book a reference DENOTES, which does not \(em "modern
numbering" is the same decision in Latin, Polish and English. Conflating
them is how a citation ends up naming the wrong book.
.PP
None of these affect
.BR \-\-raw ,
which emits every citation exactly as stored, byte for byte.
.SH UNKNOWN KEYS AND SECTIONS
A key inside
.B [defaults]
that is none of the four settings above, and a section that is not named
.BR defaults ,
are each reported \(em on standard error, prefixed with the config file's
own path \(em and then
.BR ignored .
Neither is fatal on its own. This is deliberate: a config file written for
a newer
.B colitur
must still work on an older one that does not yet recognise every setting,
but silently discarding a line the user wrote is exactly how a setting they
believe is active quietly does nothing. The two are reported separately,
worded differently, so a misspelled
.B SECTION
(the whole block silently doing nothing) reads differently from a
misspelled
.B KEY
inside an otherwise\-recognised one:
.RS
.nf

colitur: ~/.config/colitur/config.ini: unknown setting "langauge" (ignored)
colitur: ~/.config/colitur/config.ini: unknown section [deafults] (ignored)
.fi
.RE
.PP
A config file that
.B EXISTS
but fails to
.B parse
at all \(em an unterminated
.RB \(lq [ \(rq ,
a
.B key = value
line before any section header \(em is a different case and is
.BR FATAL :
exit
.BR 2 ,
naming the file and the reason, on
.B every
command, not only ones that read
.IR lang / overlay / template / format .
The config file is loaded once, unconditionally, before any command
dispatches \(em a config the user wrote and colitur cannot honour at all is
not something to silently carry on past, even for a command
(
.B \-\-help
included) that would not otherwise have consulted it.
.SH SHOWING THE RESOLVED CONFIGURATION
.BI "colitur config " \-\-show
prints the config file's own path and whether it exists, then every one of
the four settings with its resolved value and where that value came from:
.BR flag ", " config " or " default .
There is deliberately no separate "provenance" function elsewhere in the
program \(em the same resolver that decides what
.B colitur day
actually uses is what
.B \-\-show
reports, so the two cannot disagree.
.PP
Flags given on the SAME
.B config \-\-show
command line preview exactly what they would resolve to on any other
command \(em
.B config
is the one command that does NOT refuse
.BR \-\-lang / \-\-overlay / \-\-template / \-\-format
as having no effect on it, because previewing their resolution
.I is
its effect.
.I overlay
has no single scalar value, so it is listed one line per effective entry
instead of one line total.
.SH WORKED EXAMPLE
Reproducible against the shipped example overlay \(em every literal below is
a real run, not a transcription. The full, absolute path is written into the
file (see the shell\-expansion note above \(em a bare
.B ~
would fail to load):
.RS
.nf
$ mkdir \-p ~/.config/colitur
$ cat > ~/.config/colitur/config.ini <<EOF
[defaults]
lang = en
overlay = $HOME/.local/share/colitur/examples/diocesan\-example.sexp
EOF
$ colitur config \-\-show
config file: /home/user/.config/colitur/config.ini (exists)
lang       en                       (config)
template   (none)                   (default)
format     (none)                   (default)
overlay    /home/user/.local/share/colitur/examples/diocesan\-example.sexp (config)
$ colitur day 2026 | head \-1
2026\-01\-01 thursday christmastide \- ef\-circumcision class\-1 white The Octave Day of the Nativity
.fi
.RE
.PP
.B day
above used
.I en
and the diocesan example overlay with no flags at all, because neither was
given on the command line; a real run with
.B \-\-lang la
or
.B \-\-overlay
would override each independently, per\-invocation, without editing the
file.
.SH SEE ALSO
.BR colitur (1)
for
.BR \-\-lang / \-\-raw ,
.BR "colitur lang" ,
and the
.B NAMING
section in full.
.PP
.BR colitur\-overlay (5)
for the overlay file format
.I overlay
names.
.SH LICENSE
AGPL\-3.0\-or\-later.