* dev: use range type from lsp-types * feat: add html document variant * feat: use new-style bytes constructors * fix: broken span usages * fix: syntax kind is changed * fix: label use pico str * fix: bib element is changed * fix: raw element is changed * fix: typst use codex * fix: package fn is removed from world trait * feat: reflexo accept typst document * docs: update changelog * dev: cargo patch * fix: typst pdf timestamp is changed * fix: pattern is renamed to tiling * dev: make eval compat * test: update snapshots * build: bump version to nightly 0.12.19-rc4 * build: bump version to 0.12.19-rc1 (#1164) * build update changelog * build: bump version to 0.12.19-rc1 * build: bump version to nightly 0.12.19-rc2 (#1221) * feat: update typst to `85d1778` * deps: lock git deps version * build: bump version to 0.12.19-rc2 * docs: remove rc in changelog * fix: mathtext formatting of typstyle * fix: completion related to mathtext * build: update cargo.lock * build: bump version to nightly 0.12.19-rc3 (#1232) * build: bump version to nightly 0.12.19-rc4 (#1239) * feat: add typst-html * feat: add typst-html * cargo patch * fix: features doesn't take effect * fix: casting * fix: broken no-content-hint * fix: snapshot * fix: remove unnecessary `fs` feature * fix: move system features feature * feat: remove nightly shim * test: update snapshot * dev: nightly v0.12.21 (#1279) * feat: update typst to `0ea6680` feat: update typst to `0ea6680` build: bump version to nightly 0.12.19 (#1261) * fix: fix lint errors * styl: fotmat * fix: build web ci * build: update cargo.toml * build: bump version to nightly 0.12.21-rc1 (#1280) * build: update typstyle & reflexo (#1336) * build: update typstyle & reflexo * dev: remove useless patches --------- Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com> * build: update version * fix: pdf gate were broken (#1285) * fix: panic on convert_datetime (#1286) * feat: run language sever with targeting html (#1284) * dev: add some debug logging * feat: html compilation * fix: revert changes * feat: adjust html interfaces * feat: lock reflexo * feat: provide exportTarget configuration * feat: export html actions when target is html * build: bump reflexo * fix: system feature gate * fix: feature gate 2 * fix: feature gate 3 * feat: make tinymist-world featured by lsp * feat: text export over typst's HTML export (#1289) * feat: add more doc, world, and task apis (#1290) * feat: add num of pages method * feat: add from_snapshot_inner method * feat: add clear_dedicates method * feat: more convertion traits * feat: add doc_get_as_value method * feat: add doc_get_as_value method * feat: add cast_run method * fix: set is compiling flag (#1293) * feat: publish {tinymist-{derive,analysis,std,vfs,world,project},typlite,crityp} crates (#1310) * build: bump version to 0.12.21-pre-rc1 * fix: deps * build: set nightly in nightly branch * docs: add readmes for publish * feat: add release crates action * dev: remove publish of sync-lsp * dev: remove useless setup * fix: remove readme * fix: publish ignore errors * fix: specify version for publish * fix: specify version for publish * feat: update tinymist-web version * test: update snapshot * fix: diverged deps --------- Co-authored-by: ParaN3xus <136563585+ParaN3xus@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| 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 in the TextMate format for Typst.
To tackle challenge of making the complex grammar for typst markup, the grammar is described by neither JSON nor YAML, but a TypeScript generator program, the ./main.ts. TypeScript ensures correct grammar by static and strong types from ./textmate.ts.
Building
The following script running the TypeScript program will generate the TextMate grammar file:
yarn compile
Testing
// Run unit tests
yarn test
// Test on typst/typst
yarn test:official
// Test on typst/packages
yarn test:packages
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.
GitHub Integration
A variant satisfying GitHub's requirement is managed on Typst Grammar Repo. You can check which version the repository is using by checking the build-ref.md or build-ref.json.
The grammar is built by the build branch's CI.
The grammar is tested continuously by the main branch's CI. Specifically, it is tested by the command in the CI script:
script/grammar-compiler add vendor/grammars/typst-grammar
You can setup your owned environment according to github-linguist's CONTRIBUTING.md to develop the variant locally.
Contributing
See CONTRIBUTING.md.