Skip to content

Conversation

@mcanouil
Copy link
Collaborator

@mcanouil mcanouil commented Jan 7, 2026

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
Copy link
Collaborator

posit-snyk-bot commented Jan 7, 2026

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
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.

2 participants