more intuitive handling of boolean configuration options

Previously all configuration options had to be set as strings,
i.e. yes, no, true and false had to be within double quotes.
This commit is contained in:
Bastien Dumont
2025-12-14 21:21:01 +01:00
parent 17da4d81d8
commit 77f14a96fe
2 changed files with 39 additions and 21 deletions

View File

@ -209,7 +209,7 @@ and should be collapsed by the macro when it is desirable:
### Common options {#common-opts}
The following metadata fields can be set as strings:
The following metadata fields can be set:
* `tcrf-references-enum-separator`:
* the string between two references in an enumeration in a reference span;
@ -219,17 +219,18 @@ The following metadata fields can be set as strings:
* defaults to `>`.
* `tcrf-only-explicit-labels`:
* set it to `true` if you want _crossrefenum_ to refer to spans with class `label` only;
* defaults to `false`.
* defaults to `false`, can be set to `true` or `yes` (without quotes).
* `tcrf-default-prefixref`:
* default value for the `prefixref` attribute;
* defaults to `yes`.
* defaults to `yes`, can be set to `no` or `false` (without quotes).
* `tcrf-default-reftype`:
* default value for the `reftype` attribute;
* defaults to `page`.
### Options specific to DOCX and ODT/Opendocument
### Options specific to DOCX, ODT/Opendocument and (by default) Typst {#docx-odt-options}
Here are some metadata fields for the `docx`, `odt` and `opendocument` formats only
Here are some metadata fields for the `docx`, `odt` and `opendocument` formats.
They are also used for `typst` unless [`tcrf-typst-crossrefenum` is set to `true`](#typst-options)
(see [above](#prefixes-tex) why they are ignored in ConTeXt and LaTeX output):
* `tcrf-page-prefix`:
@ -256,7 +257,7 @@ Here are some metadata fields for the `docx`, `odt` and `opendocument` formats o
* defines if the prefixes of the type printed first in a reference to page and note
should be repeated (like in “p. 6, n. 1 and p. 9, n. 3”)
or set globally at the beginning of the enumeration (like in “pp. 6, n. 1 and 9, n. 3”);
* defaults to `no`, can be set to `yes`.
* defaults to `no`, can be set to `yes` or `true` (without quotes).
* `tcrf-pagenote-first-type`:
* the type of the reference number that is printed first in references to page and note;
* defaults to `page`, can be set to `note`.
@ -321,3 +322,9 @@ not that:
[@Jones1973, p. 5-70[]{#ref-to-jones}; @Doe2004]
```
# Breaking changes
Until December 2025, `yes`, `no`, `true` and `false` as metadata values
had to be put within double quotes. Now, they must not be quoted at all,
which is a more standard way to handle boolean values in YAML.