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

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.9
File Size Uploaded
tree_sitter_carve-0.1.9.tar.gz 1.4 MB Details

Built distributions (wheels)

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

Total release size: 5.2 MB

Release files / tree_sitter_carve-0.1.9.tar.gz

Download URL tree_sitter_carve-0.1.9.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
9fa3c3dc67071821a0a8398b637dcd683d3cd54388567126007a3023e31c838f
BLAKE2b-256 checksum
How to use checksums
8484eb1eb512309a1ecc4b2b4ca98c2d147ef1705543b0c33248e2e31b82d3d5
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.9-cp38-abi3-win_amd64.whl

Download URL tree_sitter_carve-0.1.9-cp38-abi3-win_amd64.whl
Size 381.2 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
67042243dc6a793ebc36fea111d29dd2f9bcfce6990d06eea19cd20c23fd1af5
BLAKE2b-256 checksum
How to use checksums
e5f64b0821da3d7d36f89bb7758c9525cbbfe8d7d66d6a8593a0f4ea420cb589
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.9-cp38-abi3-win32.whl

Download URL tree_sitter_carve-0.1.9-cp38-abi3-win32.whl
Size 378.8 kB
Tags CPython 3.8 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
35a3f9b536f27b72e5550b71459bb7d32b906d5236c993765d107a1449370907
BLAKE2b-256 checksum
How to use checksums
b7249d08a3ca72c8e5a5768e043a0ed5c71bdb22154b3246aa8971baeeec0db7
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.9-cp38-abi3-musllinux_1_2_x86_64.whl

Download URL tree_sitter_carve-0.1.9-cp38-abi3-musllinux_1_2_x86_64.whl
Size 657.3 kB
Tags CPython 3.8 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
3b7ec1c0e97e64e6632544bcaeb549c18db141cd9fb3c50213231a1ea99a2ead
BLAKE2b-256 checksum
How to use checksums
ee2365fd20ebcbdc7d70072b12cb5439c4874cd5e43ce8f65b1cb5574acc99d6
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.9-cp38-abi3-musllinux_1_2_i686.whl

Download URL tree_sitter_carve-0.1.9-cp38-abi3-musllinux_1_2_i686.whl
Size 656.9 kB
Tags CPython 3.8 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
4da3b34a10d9fa603239ca849b06cb5046b65515e9c852ea0f01394414a6da4e
BLAKE2b-256 checksum
How to use checksums
ce02000ed2a6f11babe3ab237d6a8d63eba4e1c75579b8f767e086094e7a153a
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.9-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.9-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 670.6 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
72ba61c19aec7525eda7424a9eb5bb5d30aa0a04e5f9baaa7f910fe4579813d5
BLAKE2b-256 checksum
How to use checksums
77cacf056fcb26d9dc8564d897c9b1a2831514291ae0fbabdfb439338d10c541
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.9-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl

Download URL tree_sitter_carve-0.1.9-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Size 666.6 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
f3e1bb2fe4dfb8bcb18ec95aaadc13d8b37395e1272742b0b7bbe10917a3bf2a
BLAKE2b-256 checksum
How to use checksums
b1c74e8a22b1ba563abaafa390312cb3d0203422a73a550d880adddc8ae36c4a
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.9-cp38-abi3-macosx_11_0_arm64.whl

Download URL tree_sitter_carve-0.1.9-cp38-abi3-macosx_11_0_arm64.whl
Size 427.1 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
eb478a65c843f7bbd5003b922f3305a202d41918230041f58b0bae4138012a7f
BLAKE2b-256 checksum
How to use checksums
2d550bc3e09b311be79fb7be779919ec53fde60aa389aa327c7c6fb303549a19
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

This release

0.1.9 This release

8 release files

0.1.8

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