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.

Metadata

Release files for tree-sitter-carve 0.1.6

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.6
File Size Uploaded
tree_sitter_carve-0.1.6.tar.gz 800.9 kB Details

Built distributions (wheels)

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

Total release size: 3.1 MB

Release files / tree_sitter_carve-0.1.6.tar.gz

Download URL tree_sitter_carve-0.1.6.tar.gz
Size 800.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ac3a6e77494cc26ea868ad95bfd398d9582de8becbb87567e41d4c3de97d4144
BLAKE2b-256 checksum
How to use checksums
ff7a75eee20d7dc3f4538762543a7128c28cdbe7c73c8746e8c68d8f0b37fa86
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.6-cp38-abi3-win_amd64.whl

Download URL tree_sitter_carve-0.1.6-cp38-abi3-win_amd64.whl
Size 230.7 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
5854e2bfa118504fed5c87e1dbcd1bbf72c000774e40501a46a6c18cda977d0a
BLAKE2b-256 checksum
How to use checksums
992c14d09bc169dd01ebae415b7bc0e572c8a16075527f4cd1af1482781c8ba2
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.6-cp38-abi3-win32.whl

Download URL tree_sitter_carve-0.1.6-cp38-abi3-win32.whl
Size 231.6 kB
Tags CPython 3.8 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
6ec5d3339101405f2b0a22c9d49205580c792a6d2773860dd1d11c576baa61af
BLAKE2b-256 checksum
How to use checksums
5913286495083918c51dc36888f24603e95ebd939aca84e4e5eda44451d3e6d4
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.6-cp38-abi3-musllinux_1_2_x86_64.whl

Download URL tree_sitter_carve-0.1.6-cp38-abi3-musllinux_1_2_x86_64.whl
Size 387.5 kB
Tags CPython 3.8 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
822a9a83b6f188206532fa0523bbdcb35de0e981eb1348492a31831aed030dd0
BLAKE2b-256 checksum
How to use checksums
e9f69d7fd26cc676c37044ea04bc35df0b1f0ca8643d5b69387ff8b1e1890857
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.6-cp38-abi3-musllinux_1_2_i686.whl

Download URL tree_sitter_carve-0.1.6-cp38-abi3-musllinux_1_2_i686.whl
Size 388.8 kB
Tags CPython 3.8 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
58ffed664381dd8ad0552239324c3904c94062280e2d268595a9b2b7e2d57190
BLAKE2b-256 checksum
How to use checksums
69a04e25a68e48eceaf8900d389aa9fb61c9358fe7957f15585d3106c0a86ea8
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.6-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.6-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 397.0 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
b59c2acec0d0791e18ea0cb5fae078e87b579f093110bf5eb671fa75a82cf0c1
BLAKE2b-256 checksum
How to use checksums
6aa9ae5ab19f409de4a32da73e911c8342f0aaea89458b2e4ecce17b120bfc9b
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.6-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl

Download URL tree_sitter_carve-0.1.6-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Size 393.8 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
530818045c8a5180414b6dc4735b9bab82ce4b0f75dda645899fc1c113792644
BLAKE2b-256 checksum
How to use checksums
e91ee3f64f4ef98cb52c9e7f6d1d5c51fb7f1fab1d922c9441ced36d03d8588b
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.6-cp38-abi3-macosx_11_0_arm64.whl

Download URL tree_sitter_carve-0.1.6-cp38-abi3-macosx_11_0_arm64.whl
Size 252.2 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7bbc6bd57957f7b092a8cab3cc9f32adc7efcf8cf7226f6313cc02582e217c27
BLAKE2b-256 checksum
How to use checksums
c5a81b6ce4f0d1ffeab0ca7529df39a03dbced6a7cf64f9032d78e80bdadbc00
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

0.1.8

8 release files

0.1.7

8 release files

This release

0.1.6 This release

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