tinymist/syntaxes/textmate
Myriad-Dreamin 24751130a5
feat: parse for clause correctly (#642)
* fix: unchanged snapshots

* feat: parse for clause correctly
2024-10-07 13:13:42 +08:00
..
scripts feat: provide more robust syntax highlight for expressions in markup context (#80) 2024-03-21 17:52:51 +08:00
tests/unit feat: parse for clause correctly (#642) 2024-10-07 13:13:42 +08:00
.gitignore feat: mark correct expression boundary on all testing files from typst/typst (#85) 2024-03-23 01:19:43 +08:00
fenced.meta.mts docs: improve and add contribution guide for syntaxes (#471) 2024-07-27 23:04:52 +08:00
fenced.mts feat: improve theme settings for raw blocks (#606) 2024-09-20 14:12:53 +08:00
main.mts feat: parse for clause correctly (#642) 2024-10-07 13:13:42 +08:00
package.json fix: the version in package.json is not bumped (#631) 2024-10-06 20:31:51 +08:00
README.md docs: improve and add contribution guide for syntaxes (#471) 2024-07-27 23:04:52 +08:00
textmate.mts feat: improve theme settings for raw blocks (#606) 2024-09-20 14:12:53 +08:00
tsconfig.json dev: fix errors after upgrading tsc and update resolution (#449) 2024-07-22 18:45:59 +08:00

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 as source.someLanguage.
    • The rests of the candidates can also be used as language tag of fenced code blocks.
  • { as: "text.xxx", candidates } - using textmate parser registered as text.xxx.
  • { as: ["text.xxx", ...restScopes], candidates } - using textmate parser text.xxx first, and restScopes parsers in order.

Contributing

See CONTRIBUTING.md.