Skip to content

feat!: draw the Typst window around Quarto's native annotations - #91

Draft
mcanouil wants to merge 14 commits into
mainfrom
feat/quarto-native-typst-annotations
Draft

mcanouil wants to merge 14 commits into
mainfrom
feat/quarto-native-typst-annotations

Conversation

@mcanouil

Copy link
Copy Markdown
Owner

Quarto now draws code annotations and filenames in Typst itself (quarto-dev/quarto-cli#14170), so this pull request removes the two Typst hot-fixes and the hotfix option.
Quarto draws the circles, the list links and their text alternatives, and the window frames them.

The window replaces Quarto's quarto-code-filename helper.
Each block's style and line chip go through a Typst state set just before the block, so a code block stays next to its annotation list and Quarto still pairs them.
A block named after its language or its label gets Quarto's filename node from the filter.
Inside the window, Quarto's own outline is removed through quarto-code-block-style, so there's only one border.
A block that sets code-window-enabled to false now shows Quarto's filename bar.

This depends on the latest commits of quarto-dev/quarto-cli#14170, and needs Quarto 1.12.
quarto-required is set to >=1.12.0 for now, and the exact version gets pinned once that pull request ships.

Before After
Two code windows rendered by Quarto with quarto-dev/quarto-cli#14170: the circled numbers sit below their code lines and look squashed, and the list numbers are small grey circles The same two code windows on this branch: each circled number sits at the end of its code line, and the list uses Quarto's circled numbers

Quarto now draws code annotations and filenames in Typst. The window replaces Quarto's quarto-code-filename helper and reads per-block settings from a Typst state set before each block. The code-annotations and Skylighting hot-fixes and the hotfix option are removed. Inline code keeps its background through its own module.
…e node

A block named after its language or its label gets Quarto's filename node from the filter, so Quarto still pairs it with its annotation list. In an executed cell, the window state goes before the cell, where Quarto expects the code first.
The window's block rule reached the blocks inside Quarto's circles, which then grew and wrapped below their line, so the rule now only removes the spacing around the code block. The filename node built for a derived name no longer brings a stray empty block, which kept Quarto from pairing the code with its annotation list.
…in Typst

The window's rule for native code blocks set a full width, which also reached the blocks inside Quarto's circles.
The fixture uses a format whose definitions partial has no filename helper, with one framed block and one block that refuses the window.
Inside the window, Quarto's code blocks lose their own radius and outline through quarto-code-block-style, and get them back after the window.
The hot-fix pages go, the reference explains how the window replaces Quarto's filename helper, and the extension now needs Quarto 1.12.
…unction

The code of an executed cell with a layout stays in its window, and an annotated block in a layout keeps its list in the same cell, so Quarto still pairs them. The filename helper clears the window state it reads, so a block the filter does not visit, such as one in a note, takes no state from the block before it. A document that defines the window function keeps its own, and the filter still defines the state and the filename helper after it.
@mcanouil mcanouil added the Type: Enhancement 💡 Issues related to enhancements, improvements, new features, or new analyses label Nov 12, 2026
@mcanouil mcanouil self-assigned this Nov 12, 2026
Framing a block now returns its window state and its node apart, so an executed cell takes the state of its code without a search through generated text. The inline-code pass is wired directly, the filter reuses the vendored Typst string escaper, the filename helper clears the state only when one is set, and example.qmd no longer documents the removed hotfix option.
In a layout of executed cells, each cell and its window state share one Div, so the layout keeps one column per cell. The changelog records the Quarto 1.12 requirement, the test fixture for replaced definitions keeps only that partial, and a test section no longer describes the removed hot-fix.
In a layout, only a block with annotation markers takes the list after it into its cell. Every new fixture now renders even without pdftotext, the layout and book tests check that Quarto's filename helper is called, and two comments name the current framing function.
When a document defines its own window function, the colour helpers and the window state still go at the top, so a framed block or inline code before that definition compiles. Only a line that ends with a space and <n> counts as an annotation marker, so code such as std::vector<1> keeps its list in its own layout cell.
@mcanouil
mcanouil marked this pull request as ready for review November 12, 2026 17:51
@mcanouil
mcanouil marked this pull request as draft November 12, 2026 17:58

This branch has not been deployed

No deployments
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