Skip to main content

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.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tree-sitter-carve 0.1.8
File Size Uploaded
tree_sitter_carve-0.1.8.tar.gz 1.3 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for tree-sitter-carve 0.1.8
File
tree_sitter_carve-0.1.8-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
tree_sitter_carve-0.1.8-cp38-abi3-win32.whl CPython 3.8 abi3 Windows x86-32 Details
tree_sitter_carve-0.1.8-cp38-abi3-musllinux_1_2_x86_64.whl CPython 3.8 abi3 Linux musl 1.2+ x86-64 Details
tree_sitter_carve-0.1.8-cp38-abi3-musllinux_1_2_i686.whl CPython 3.8 abi3 Linux musl 1.2+ x86-32 Details
tree_sitter_carve-0.1.8-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.8-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.8-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details

Total release size: 5.0 MB

Release files / tree_sitter_carve-0.1.8.tar.gz

Download URL tree_sitter_carve-0.1.8.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
5f31ee04591a0cf8d9b7aceec54b548c02208252c93aba76b28870c0fedad04b
BLAKE2b-256 checksum
How to use checksums
3b463e8240b95be9e33aed072e45c9d7ba31f1cdd13d9b194f9bb6b5abc250ba
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.8-cp38-abi3-win_amd64.whl

Download URL tree_sitter_carve-0.1.8-cp38-abi3-win_amd64.whl
Size 360.6 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3c3c1b97e2edd7ebd2e95411dad2a23977cc828eefebd149c672442a1261a94d
BLAKE2b-256 checksum
How to use checksums
07dd123cb46e279ee40cf87cb24ee4da3b000b029fc23c9368b56a7f6e2ce4db
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.8-cp38-abi3-win32.whl

Download URL tree_sitter_carve-0.1.8-cp38-abi3-win32.whl
Size 358.5 kB
Tags CPython 3.8 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
a09b956614697e138f2e9a34ab6373c8444773de26a629a58c500d21ed06d46f
BLAKE2b-256 checksum
How to use checksums
bec52d2d1573ffff907a15bebda562f715a2ad0a146581fe792fe30ad39efaba
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.8-cp38-abi3-musllinux_1_2_x86_64.whl

Download URL tree_sitter_carve-0.1.8-cp38-abi3-musllinux_1_2_x86_64.whl
Size 616.7 kB
Tags CPython 3.8 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
99a6492b5121ca15d92d2ae884f2a64688003a0a97fdb906314c58f6d765a2d0
BLAKE2b-256 checksum
How to use checksums
78b3ea7b975446d714bf40965e0e639194a9247f18a0374910ad6bcef6388ea8
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.8-cp38-abi3-musllinux_1_2_i686.whl

Download URL tree_sitter_carve-0.1.8-cp38-abi3-musllinux_1_2_i686.whl
Size 619.6 kB
Tags CPython 3.8 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
3c1e363129e1f5c6e01cd136b314edd43e432e15f9901acae9ffd2b118397585
BLAKE2b-256 checksum
How to use checksums
79578219bce84dbe21487a01a3f8b9fbce75dada671a44ddbb4bc75594041d87
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.8-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.8-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 631.7 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
c16858df0068e58e1d9229b0463864f10e8690088d0efe088b18f0b7f15f382d
BLAKE2b-256 checksum
How to use checksums
d8decb38702ea896122e6b79a91277ba0ee75fe4ef058855b5238794e9703417
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.8-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl

Download URL tree_sitter_carve-0.1.8-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Size 628.3 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
f920c44823e847ac020dcb442e497220fb0c149f66d19a0449cf98150ffa95b4
BLAKE2b-256 checksum
How to use checksums
15373277b686301d74c44e012a376d2e89dfb22191a0750c24e9a2a4ebabe3aa
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.8-cp38-abi3-macosx_11_0_arm64.whl

Download URL tree_sitter_carve-0.1.8-cp38-abi3-macosx_11_0_arm64.whl
Size 403.8 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d4b4267520473be5707c11e9042c5bf96865809214d527feedea71bf10d8536d
BLAKE2b-256 checksum
How to use checksums
0847480fd8d267fade1bd2d5b5c46506f11f883b8b814f66428febbee125e920
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.1.9

8 release files

This release

0.1.8 This release

8 release files

0.1.7

8 release files

0.1.6

8 release files

0.1.5

8 release files

0.1.4

8 release files

0.1.3

8 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page