mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-25 21:37:32 +00:00
* feat: add experimental math syntax highlighting * dev: math identifier can be after some text brace * dev: math identifier must contain multiple chars |
||
|---|---|---|
| .. | ||
| scripts | ||
| tests/unit | ||
| .gitignore | ||
| feature.mts | ||
| fenced.meta.mts | ||
| fenced.mts | ||
| main.mts | ||
| package.json | ||
| README.md | ||
| textmate.mts | ||
| tsconfig.json | ||
Syntax Highlighting for Typst
This folder contains the syntax highlighting for Typst. The syntax highlighting is written in the TextMate format.
The syntax highlighting is written in TypeScript, and ensures correct grammar by ./textmate.ts.
Building
The following script running the TypeScript program will generate the TextMate grammar file:
yarn compile
Testing
yarn test
Register languages for raw highlighting
Goto fenced.meta.mts and add a line like this:
{ "candidates": ["erlang"] }
Three possible kinds:
{ candidates: ["someLanguage", ...rests] }- using textmate parser registered assource.someLanguage.- The
restsof the candidates can also be used as language tag of fenced code blocks.
- The
{ as: "text.xxx", candidates }- using textmate parser registered astext.xxx.{ as: ["text.xxx", ...restScopes], candidates }- using textmate parsertext.xxxfirst, andrestScopesparsers in order.
Contributing
See CONTRIBUTING.md.