Skip to content

feat: add Checker:cells for comment-pipe cell options - #16

Merged
mcanouil merged 3 commits into
mainfrom
feat/checker-cells
Oct 26, 2026
Merged

mcanouil merged 3 commits into
mainfrom
feat/checker-cells

Conversation

@mcanouil

Copy link
Copy Markdown
Owner

This adds Checker:cells(options, language), which checks the comment-pipe options of one code cell (#|, //|) against the new cells section 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 cells section, 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, format and cells all repeated into one helper.
It doesn't change behaviour.

The tests pass locally (quarto pandoc lua tests/run.lua, 238 checks).

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.
@mcanouil mcanouil added the Type: Enhancement 💡 Issues related to enhancements, improvements, new features, or new analyses label Oct 26, 2026
@mcanouil mcanouil self-assigned this Oct 26, 2026
@mcanouil
mcanouil marked this pull request as ready for review October 26, 2026 11:59
@mcanouil
mcanouil merged commit a80d817 into main Oct 26, 2026
@mcanouil
mcanouil deleted the feat/checker-cells branch October 26, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Enhancement 💡 Issues related to enhancements, improvements, new features, or new analyses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant