tree-sitter-carve
Tree-sitter grammar for Carve, a lightweight markup language for readable source and structured documents.
It provides editor-facing parsing, highlighting, and structural navigation for Carve syntax, including:
/italic/,*bold*, and/*bold italic*/=highlight=, plus the braced-only{^superscript^}and{,subscript,}(a bare^or,is literal text)$plus backtick math spans, and$$plus backtick display math spans:name[content]inline extensions,@mentions,#tags, and:emoji:%%line comments, trailing inline%%comments, and%%%fenced comments- headings, lists, tables, fenced code, links, images, attributes, footnotes, captions, and divs
Scope
This repository is the grammar layer, not the canonical parser or renderer. It aims to produce useful, error-free syntax trees for the covered Carve corpus. The Carve specification defines the language; engine conformance and rendered output are checked in their respective implementation repositories.
The grammar is intentionally explicit about unsupported corpus categories.
test/coverage.json records each category as covered or skipped with a reason,
so new syntax cannot silently fall outside the checks.
Browser use
Each release ships tree-sitter-carve.wasm in the npm package and as a GitHub
release asset. Copy that file to a URL served by your application, then load it
with web-tree-sitter:
import { Language, Parser, Query } from "web-tree-sitter";
await Parser.init();
const carve = await Language.load("/parsers/tree-sitter-carve.wasm");
const parser = new Parser();
parser.setLanguage(carve);
const tree = parser.parse("# Hello");
const highlights = await fetch("/queries/carve-highlights.scm").then(
(response) => response.text(),
);
const query = new Query(carve, highlights);
const captures = query.captures(tree.rootNode);
The npm copy is at
node_modules/tree-sitter-carve/tree-sitter-carve.wasm. The matching release
asset includes a .sha256 checksum. Highlight and injection queries are in the
package's queries/ directory.
CI tests this grammar with web-tree-sitter 0.22.6 and 0.27.0. Version 0.22.6
uses the older default Parser export and language.query(...) API; the
example above uses the 0.27.0 API.
Development
Contributor setup, corpus checks, generated-artifact hygiene, and maintenance notes are in the development guide. The September 30 audit records remaining syntax gaps and the added editor queries.
Metadata
Release files for tree-sitter-carve 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tree_sitter_carve-0.1.7.tar.gz | 1.1 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| tree_sitter_carve-0.1.7-cp38-abi3-win_amd64.whl | CPython 3.8 | abi3 | Windows x86-64 | Details |
| tree_sitter_carve-0.1.7-cp38-abi3-win32.whl | CPython 3.8 | abi3 | Windows x86-32 | Details |
| tree_sitter_carve-0.1.7-cp38-abi3-musllinux_1_2_x86_64.whl | CPython 3.8 | abi3 | Linux musl 1.2+ x86-64 | Details |
| tree_sitter_carve-0.1.7-cp38-abi3-musllinux_1_2_i686.whl | CPython 3.8 | abi3 | Linux musl 1.2+ x86-32 | Details |
| tree_sitter_carve-0.1.7-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ x86-64, Linux glibc 2.5+ x86-64 | Details |
| tree_sitter_carve-0.1.7-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl | CPython 3.8 | abi3 | Linux glibc 2.5+ x86-32, Linux glibc 2.17+ x86-32 | Details |
| tree_sitter_carve-0.1.7-cp38-abi3-macosx_11_0_arm64.whl | CPython 3.8 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 4.0 MB
Release files / tree_sitter_carve-0.1.7.tar.gz
| Download URL | tree_sitter_carve-0.1.7.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee7144fcac350d2387955d4023a15d16508b985896b658c3e4896eea9de322b9
|
|
BLAKE2b-256 checksum How to use checksums |
d22d758850e16600c8c36deed9d610b0082fc06e652e8996da5bc230be1c68e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tree_sitter_carve-0.1.7-cp38-abi3-win_amd64.whl
| Download URL | tree_sitter_carve-0.1.7-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 297.3 kB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
4ac54ff0af7b4066a5665ce15b31cdc6bc11d2db0cf233e874f5156a42a47b23
|
|
BLAKE2b-256 checksum How to use checksums |
311953b967166f62823d2c2050448bf59de11c73a4d160b8112f7c24b06ab27e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tree_sitter_carve-0.1.7-cp38-abi3-win32.whl
| Download URL | tree_sitter_carve-0.1.7-cp38-abi3-win32.whl |
|---|---|
| Size | 297.1 kB |
| Tags | CPython 3.8 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
fad8e90f4d2814656a905341a45fadf9c62bf7be502a66177a5920b7fb80b422
|
|
BLAKE2b-256 checksum How to use checksums |
885a73f2862e1b3170bedb928c5e1be5113e92b869a4d1424fb003d7b44ac20a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tree_sitter_carve-0.1.7-cp38-abi3-musllinux_1_2_x86_64.whl
| Download URL | tree_sitter_carve-0.1.7-cp38-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 489.3 kB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b7869270604504df067862c852b3a25512c9ee4350f061d486c9b99ede802f65
|
|
BLAKE2b-256 checksum How to use checksums |
2d171fb61797fa989f71057264738793a6e11c0b8270209e5279d9217fdd5f8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tree_sitter_carve-0.1.7-cp38-abi3-musllinux_1_2_i686.whl
| Download URL | tree_sitter_carve-0.1.7-cp38-abi3-musllinux_1_2_i686.whl |
|---|---|
| Size | 491.5 kB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
f0ef49b4ec34d092e8c0878233e7b489aedeb0c371d524a888a0936c9247556e
|
|
BLAKE2b-256 checksum How to use checksums |
3c63421f57f266b13f0537b4b29ef7566deaf3cd80d50d2eab14635dd19245bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tree_sitter_carve-0.1.7-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | tree_sitter_carve-0.1.7-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 506.9 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
24b33881cf5d00effcdfcd9baabef2931b102d638b7cc28caff3850884e97940
|
|
BLAKE2b-256 checksum How to use checksums |
a52d77fbcf69951bd741390bcb5a011c2834c5d334f42585064b98b8e9e09ae0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tree_sitter_carve-0.1.7-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | tree_sitter_carve-0.1.7-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 504.7 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-32 Linux glibc 2.5+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
d38596ce6acf0be11f749bb0c670f60c41b69922defa033c9243349738a5c0ea
|
|
BLAKE2b-256 checksum How to use checksums |
d117e6950cc0adea4668b5149beced1ce7d8ff27c6c75fbe6804aad4092aa14d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tree_sitter_carve-0.1.7-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | tree_sitter_carve-0.1.7-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 339.4 kB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c9eeb3b6714fcf10a824e7aebd6a4c16033805de83d613e3fc75c97f50536798
|
|
BLAKE2b-256 checksum How to use checksums |
d2fa409a4445eb38f0cd06fefc14403cb9bfd43c87e52ea95ce4ed8483ca3c88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|