Skip to content

feat: add public code-window-auto-label attribute - #82

Merged
mcanouil merged 7 commits into
mainfrom
feat/public-auto-label
Nov 4, 2026
Merged

mcanouil merged 7 commits into
mainfrom
feat/public-auto-label

Conversation

@mcanouil

@mcanouil mcanouil commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Another filter can now ask Code Window for a window on a block that has no filename.
It sets code-window-auto-label to 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-auto class, 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" or code-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.yml and docs/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, and tests/run.sh passes all 40 checks locally.

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.
@mcanouil mcanouil added the Type: Enhancement 💡 Issues related to enhancements, improvements, new features, or new analyses label Nov 4, 2026
@mcanouil mcanouil self-assigned this Nov 4, 2026
@mcanouil
mcanouil marked this pull request as ready for review November 4, 2026 22:29
@mcanouil
mcanouil merged commit 0ed7846 into main Nov 4, 2026
@mcanouil
mcanouil deleted the feat/public-auto-label branch November 4, 2026 22:29
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