Skip to content

refactor: read the hot-fix defaults from the schema - #100

Merged
mcanouil merged 5 commits into
mainfrom
refactor/hotfix-defaults-from-schema
Nov 23, 2026
Merged

mcanouil merged 5 commits into
mainfrom
refactor/hotfix-defaults-from-schema

Conversation

@mcanouil

@mcanouil mcanouil commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

The hot-fix defaults now come from _schema.yml, like the seven top-level options, so a default changed in the schema alone takes effect.

The vendored validator moves to schema 2.4.0, which builds an absent type: object option from the defaults of its properties (mcanouil/quarto-wizard#544).
checker:options therefore answers hotfix = {code-annotations = true, skylighting = true} when the document sets none, and the hot-fix loop reads its defaults from there.
HOTFIX_DEFAULTS stays as the fallback for a format the extension does not act on and for a schema that cannot be read.
quarto-lua-modules moves to 2.13.0 as well; its six vendored files are byte-identical, so only the manifest changes.

A schema default can take the map form the schema allows, such as {enabled: false}, and is read like the same map in the document.
Only a metadata map is read as a map; any other value, a list included, is read as text as before.

New tests render projects with their own copy of the extension: a skylighting default of false, a map default, and no schema at all.
Two more pin a list value and the quarto-version threshold, on both sides of the running Quarto.
example.qmd renders byte-identical to main in HTML and Typst.

Schema 2.4.0 builds the hotfix object from the defaults of its properties, so a default changed in _schema.yml alone now takes effect. HOTFIX_DEFAULTS stays only as the fallback for a format the extension does not act on and for a schema that cannot be read.
@mcanouil mcanouil added the Type: Refactor 🔥 Issues related to refactoring, restructuring, or cleaning up label Nov 23, 2026
@mcanouil mcanouil self-assigned this Nov 23, 2026
The schema types each hot-fix as a boolean or a map, so a map default is now read like the same map in the document rather than dropped.
@mcanouil
mcanouil marked this pull request as ready for review November 23, 2026 11:55
@mcanouil
mcanouil merged commit 158a0ae into main Nov 23, 2026
2 checks passed
@mcanouil
mcanouil deleted the refactor/hotfix-defaults-from-schema branch November 23, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Refactor 🔥 Issues related to refactoring, restructuring, or cleaning up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant