mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-04 18:28:02 +00:00
![]() * feat: terminate call arguments before some FIRST tokens * feat: terminate braces before some FIRST tokens * feat: terminate set clause on some FIRST tokens * feat: refine rules to terminate a math call |
||
---|---|---|
.. | ||
scripts | ||
tests | ||
.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
rests
of 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.xxx
first, andrestScopes
parsers in order.
Contributing
See CONTRIBUTING.md.