tinymist/syntaxes/textmate
Myriad-Dreamin 27460a9c53
build: bump version to 0.12.8 (#940)
* build: bump version to 0.12.8

* fix: bump versions in package.json files
2024-12-03 22:27:57 +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: recursively parse markup link according to typst syntax (#911) 2024-11-29 15:43:38 +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: recursively parse markup link according to typst syntax (#911) 2024-11-29 15:43:38 +08:00
package.json build: bump version to 0.12.8 (#940) 2024-12-03 22:27:57 +08:00
README.md chore: Fix typos throughout code base (manual) 2024-11-25 09:26:53 +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.