Collection of TextMate grammars and themes, converted in JSON format and re-distributed as npm packages.
Packages are automatically updated and published every day (if there are changes).
Scripts are extracted and modified from Shiki.
- Fork this repository
- Install the dependencies with
pnpm i
- Add grammar source and metadata to
sources-grammars.ts
- Add a code sample file
<id>.sample
for your language under./samples
. A sample should include a variety of language syntaxes and succinctly capture the idiosyncrasy of a language. Format requirements:
- Space for indentation
- Less than 100 columns if possible
- Link to source in the last line, for example,
# From
https://poignant.guide/book/chapter-5.html`
- Generate a personal access token, keep the default, no extra permission is needed. This token is used to query public information from GitHub API and avoid rate limits.
- Create a
.env
file and paste your generated token into the file like so:
GITHUB_TOKEN=your-personal-access-token
- Run
pnpm run fetch
to download the grammar and verify it works - Send in the PR!
- Fork this repository
- Install the dependencies with
pnpm i
- Add theme source and metadata to
sources-themes.ts
- Generate a personal access token, keep the default, no extra permission is needed. This token is used to query public information from GitHub API and avoid rate limits.
- Create a
.env
file and paste your generated token into the file like so:
GITHUB_TOKEN=your-personal-access-token
- Run
pnpm run fetch
to download the theme and verify it works - Send in the PR!
The grammars included in this package are covered by their repositories’ respective licenses, which are permissive (apache-2.0, mit, etc), and made available in Grammars NOTICE and Themes NOTICE.
All other files MIT © Pine Wu & Anthony Fu