Repository navigation
feat: add public code-window-auto-label attribute - #82
Merged
Merged
Conversation
Another filter can now ask for a window on a block that has no filename, without copying the internal cw-auto marker. The label frames the block even when auto-filename is off, and an explicit filename or a per-block opt-out still wins.
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.
Another filter can now ask Code Window for a window on a block that has no
filename.It sets
code-window-auto-labelto the label it wants, and Code Window frames the block in the derived-filename style, in HTML and in Typst.Until now the only way was to copy the internal
cw-autoclass, which quarto-atelier does for its terminal blocks and which can change without notice.The label asks for a window by itself, so it works even when the document sets
auto-filename: false.An explicit
filename,code-window-enabled="false"orcode-window-no-auto-filename="true"still wins over it.The language pass keeps a label that is already on the block, and it skips a labelled block that refuses the window, so that block keeps the language its author wrote.
The attribute is in
_schema.ymlanddocs/reference.qmd, with a short section for filter authors.A new fixture,
tests/fixtures/auto-label-forced.qmd, covers the forced label, the opt-outs and an unknown language, andtests/run.shpasses all 40 checks locally.