Open Iorvethe opened 1 month ago
I noticed that. The embedded document marks these code as example
language, so we need a preprocessor to mark them all as typst
language. This needs some effort.
/// ```example
/// #set text(font: "New Computer Modern")
///
/// Let $a$, $b$, and $c$ be the side
/// lengths of right-angled triangle.
/// Then, we know that:
/// $ a^2 + b^2 = c^2 $
///
/// Prove by induction:
/// $ sum_(k=1)^n k = (n(n+1)) / 2 $
/// ```
Motivation
Annotating code snippets as Typst code in Markdown docs would make them correctly highlighted by Treesitter’s injection queries.
Description
I use Helix and currently when requesting docs for an item, code snippets inside aren’t highlighted as Typst code. I do not know whether the issue is with annotating the code or something else, but I suppose it is something in that vein. When writing Markdown and including a Typst snippet, it is correctly highlighted for example.
Examples/Questions