markup-carve / carve-grammars
Syntax-highlighting grammars for the Carve markup language (TextMate grammar for Torchlight / phiki, plus Prism and highlight.js definitions)
Package info
github.com/markup-carve/carve-grammars
Language:JavaScript
pkg:composer/markup-carve/carve-grammars
Requires
- php: >=8.1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 0.1.x-dev
- v0.1.24
- v0.1.23
- v0.1.22
- v0.1.21
- v0.1.20
- v0.1.19
- v0.1.18
- v0.1.17
- v0.1.16
- v0.1.15
- v0.1.14
- v0.1.13
- v0.1.12
- v0.1.11
- v0.1.10
- v0.1.9
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- dev-release/0.2.0
- dev-chore/pins-main-1203
- dev-chore/pins-0.2.0
- dev-fix/7385-leaf-extension-grammar-ci
- dev-fix/7385-leaf-extension-grammar
- dev-prototype/1021-rootcause
- dev-prototype/1021-localdiff-trial
- dev-prototype/1021-atomic-div
- dev-prototype/1021-flat-div
- dev-prototype/1021-cap16
- dev-prototype/1021-cap4
- dev-prototype/1021-cap8-archive
- dev-prototype/1021-openers-text
This package is auto-updated.
Last update: 2026-12-04 04:57:27 UTC
README
Syntax highlighting for Carve 0.2 in Prism, highlight.js, TextMate, and Shiki. The language name is carve; crv is its file extension alias. These grammars replace the 0.1 grammars. The package also ships a Tiptap editor kit for the 0.2 tree.
Install
npm install @markup-carve/carve-grammars prismjs
Prism
import Prism from 'prismjs' import '@markup-carve/carve-grammars/prism/carve.js' Prism.highlight(source, Prism.languages.carve, 'carve')
For highlight.js, import @markup-carve/carve-grammars/highlightjs/carve.js and register it as carve. For TextMate, load textmate/carve.tmLanguage.json. For Shiki, import carveMarkdown or carveGrammar from the package root or @markup-carve/carve-grammars/shiki.
The package also ships host helpers that work with any of these: diff and shiki/diff for {.diff} fences, diagrams for Graphviz, D2 and PlantUML blocks, and fence-languages.json, the fence-word table editor grammars embed by. See the reference.
Tiptap
@markup-carve/carve-grammars/tiptap loads Carve 0.2 into a Tiptap editor and writes it back. You pass in the carve-js engine, so the kit never bundles it.
import { Editor } from '@tiptap/core' import * as carve from '@markup-carve/carve' import { CarveKit, carveToProseMirror, serializeToCarve } from '@markup-carve/carve-grammars/tiptap' const editor = new Editor({ extensions: [CarveKit], content: carveToProseMirror(source, { engine: carve }) }) const next = serializeToCarve(editor.getJSON(), { engine: carve, source })
See the Tiptap kit guide.
See the migration guide for every renamed path and removed surface.