feat: check the document configuration against the extension schema - #54
Merged
Merged
Conversation
mcanouil
marked this pull request as ready for review
September 6, 2026 21:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the runtime schema check to
code-windowand moves the manifest toquarto-lua-modules2.2.0.The manifest now declares
schema-check.luaalongside thelogging.luaandstring.luasiblings it loads, and addsquarto-wizard3.5.0 forschema.lua, fetched from the release asset.main.luabuilds the checker at file scope and hands it tocode-window.lua, which is where the filter registration actually lands, becausemain.luaregisterscode_window.Meta, so the call sits at the top of that handler and before the first option is read.A probe under
extensions.code-windowreported an out-of-enumstyleand an unrecognised key the extension never reads, and the documented configuration produced no message at all.Deleting the vendored
schema-check.luaaborts the documentation render, which proves the check is reached rather than merely present.Two disagreements between the schema and the code that reads it, both recorded and left uncorrected.
Booleans:
_vendor/quarto-wizard/schema.lua:317coercesyesandnoto real booleans, soenabled: yespasses the check in silence, whilecode-window.lua:726compares the stringified value against the exact stringtrueand turns the extension off.Rendered both ways,
enabled: trueproduced the window markup andenabled: yesproduced none.The same idiom carries
auto-filename,cell-outputandlines-labelatcode-window.lua:727,729and732against_schema.yml:9,18and31, and the threehotfixentries atcode-window.lua:719against_schema.yml:39,50and61.Wrapper:
_schema.yml:22declarestype: stringwith no pattern, sowrapper: "my window"passes the check andcode-window.lua:730writes it into the Typst source, where the compile then fails.Two things this repository turns out not to have.
The schema declares no
enumCaseInsensitive, sostyle: MACOSis rejected by the check and by the extension alike.The
collapseenum mixes baretrueandfalsewith strings and is harmless as a document option, sincecollapse: truepassed the check and applied the collapsed mode.Correcting the schema is separate work, and nothing here changes what the extension does with a valid configuration.