Repository navigation
feat: add Checker:cells for comment-pipe cell options - #16
Merged
Merged
Conversation
Checks one code cell's options against the cells section of the schema, keyed by cell language, so a cell extension no longer matches unrelated display blocks through the attributes section. It needs a validator that provides validate_cells, and reports once otherwise.
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
Checker:cells(options, language), which checks the comment-pipe options of one code cell (#|,//|) against the newcellssection of Quarto Wizard schema 2.3.0 and returns what they resolve to.Code-cell extensions such as typst-render check those options through
Checker:attributes(opts, 'typst')today.That also matches
{.typst}blocks that only display code.Keying the check by cell language avoids that.
It follows
Checker:attributes.A language that is not a string is reported as misuse.
With no schema or no
cellssection, the options come back unchanged.A validator vendored before 2.3.0 has no
validate_cells, so that is reported once per render rather than raised.Findings are reported at warning level, as attribute findings are, because the cell renders the same either way.
A second commit moves the error and warning loop that
attributes,formatandcellsall repeated into one helper.It doesn't change behaviour.
The tests pass locally (
quarto pandoc lua tests/run.lua, 238 checks).