Example/template repository for building a language package
  • JavaScript 52.5%
  • TypeScript 47.5%
Find a file
2025-07-28 08:32:29 +02:00
src Move to @lezer/highlight 2022-04-04 16:58:05 +02:00
test Update test.js 2021-12-11 11:23:45 +01:00
.gitignore Initial setup 2021-02-12 17:19:21 +01:00
.npmignore Initial setup 2021-02-12 17:19:21 +01:00
LICENSE Add license file 2021-12-01 08:10:38 +01:00
package.json Major bump of dependencies 2025-07-28 08:30:32 +02:00
README.md Adjust wording in readme 2022-07-25 12:13:58 +02:00
rollup.config.js Major bump of dependencies 2025-07-28 08:30:32 +02:00
tsconfig.json Simplify tsconfig 2025-07-28 08:32:29 +02:00

CodeMirror 6 language package template

This is an example repository containing a minimal CodeMirror language support package. The idea is to clone it, rename it, and edit it to create support for a new language.

Things you'll need to do (see the language support example for a more detailed tutorial):

  • git grep EXAMPLE and replace all instances with your language name.

  • Rewrite the grammar in src/syntax.grammar to cover your language. See the Lezer system guide for information on this file format.

  • Adjust the metadata in src/index.ts to work with your new grammar.

  • Adjust the grammar tests in test/cases.txt.

  • Build (npm run prepare) and test (npm test).

  • Rewrite this readme file.

  • Optionally add a license.

  • Publish. Put your package on npm under a name like codemirror-lang-EXAMPLE.