Skip to content

feat(constants.lua): add typst and ojs comment symbols for code-annotations - #13856

Merged
cderv merged 5 commits into
quarto-dev:mainfrom
mcanouil:feat/code-annotation-languages
Jan 16, 2026
Merged

cderv merged 5 commits into
quarto-dev:mainfrom
mcanouil:feat/code-annotation-languages

Conversation

@mcanouil

@mcanouil mcanouil commented Jan 7, 2026 •

Copy link
Copy Markdown
Collaborator

Introduce comment symbols for the Typst and OJS languages for the code annotations feature.

In addition, languages are now sorted to make it easier to see/find the languages.

I've added a test for all 49 languages defined in constants.lua.
Note that all supported languages do not necessarily have proper code highlighting but that does not block the code-annotation feature to work.


Context: Writing a blog post with Typst code blocks and had to use # which is not Typst comment symbol.

The document below should work, especially since Typst s embedded in Quarto.

---
format: html
code-annotations: true
---

```{.typst filename="Typst"}
#let my-badge(content, colour: "neutral") = { // <1>
  box( // <2>
    fill: luma(230), // <3>
    radius: 4pt,
    inset: 0.25em,
    text(size: 0.85em, content)
  )
}
```

1. Function definition with content parameter and optional named parameter.
2. [`box`](https://typst.app/docs/reference/layout/box/) creates an inline container.
3. [`luma`](https://typst.app/docs/reference/visualize/color/#definitions-luma) creates a greyscale colour (0-255).

@mcanouil mcanouil self-assigned this Jan 7, 2026
@posit-snyk-bot

posit-snyk-bot commented Jan 7, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@mcanouil
mcanouil marked this pull request as ready for review January 8, 2026 23:09
Comment thread news/changelog-1.9.md Resolved

@cderv cderv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

@cderv
cderv merged commit 03dc6fb into quarto-dev:main Jan 16, 2026
2 of 9 checks passed
@mcanouil
mcanouil deleted the feat/code-annotation-languages branch January 16, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants