tinymist/syntaxes/textmate
Myriad-Dreamin d4ba43c773
feat: add experimental math syntax highlighting (#1096)
* feat: add experimental math syntax highlighting

* dev: math identifier can be after some text brace

* dev: math identifier must contain multiple chars
2025-01-03 23:15: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: 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
feature.mts feat: add experimental math syntax highlighting (#1096) 2025-01-03 23:15:42 +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: add experimental math syntax highlighting (#1096) 2025-01-03 23:15:42 +08:00
main.mts feat: add experimental math syntax highlighting (#1096) 2025-01-03 23:15:42 +08:00
package.json build: bump version to 0.12.16 (#1099) 2025-01-02 21:28:50 +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.