OCaml package that exposes TextMate grammars as JSON strings. Each language is available as a library ([tm-grammars.ocaml], [tm-grammars.tsx], etc.) so downstream users only link what they need.
opam install tm-grammars -y(libraries tm-grammars)let grammar_ocaml = Tm_grammars.ocaml
let grammar_tsx = Tm_grammars.tsxYou can also list grammars dynamically:
let all = Tm_grammars.all (* (string * string) list *)
let ids = Tm_grammars.available (* string list *)Depend on a sublibrary to pull in only the grammar you need.
(libraries tm-grammars.ocaml tm-grammars.tsx)let grammar_ocaml = Tm_grammar_ocaml.json
let grammar_tsx = Tm_grammar_tsx.jsonc, cpp, cram, css, diff, dockerfile, dune, go, graphql, html, java, javascript, json, jsonc, makefile, markdown, menhir, mlx, ocaml, ocamllex, opam, python, reason, ruby, rust, shellscript, sql, toml, tsx, typescript, yaml.
repo, path, commit).make sync to download the grammar into vendor/<language-id>.json.make generate to regenerate packages and metadata.make build (and optionally make test) to verify everything still builds.MIT. See LICENSE.