Skip to content

Get Started

Use the Playground without installing anything. The Cheat Sheet lists the syntax.

Install a renderer

The JavaScript, PHP, and Rust implementations are tested with the same Carve documents and expected output.

JavaScript / TypeScript — carve-js

bash
npm install @markup-carve/carve
ts
import { carveToHtml } from '@markup-carve/carve'

const html = carveToHtml('/italic/, *bold*, and a heading')

The package also exposes parse and Markdown, plain-text, and ANSI renderers.

Rust — carve-rs

bash
cargo install carve-lang
bash
# CLI: convert a .crv file to HTML
carve input.crv

Browser / Node via WebAssembly — carve-wasm

carve-wasm wraps carve-rs. See its repository for the current browser and server-side JavaScript APIs.

PHP — carve-php

bash
composer require markup-carve/carve-php
php
use MarkupCarve\Carve\CarveConverter;

$html = (new CarveConverter())->convert('/italic/, *bold*, and a heading');

CarveConverter::convert() returns HTML. The package also provides parse, other output formats, and format converters.

Language bindings

These bindings use carve-rs:

LanguageProjectInstall
Pythoncarve-pyfrom Git (PyPI pending)
Rubycarve-rbgem install carve-lang
Gocarve-gogo get github.com/markup-carve/carve-go

Editor and framework integrations are listed in the Ecosystem.

Read the reference

Features available by default and optional features

Headings, lists, tables, links, code, math, footnotes, callouts, and attributes are available without configuration.

A few features must be enabled separately:

  • Available everywhere, but opt-in — citations [@key], bare-URL autolinking, mention/tag → URL templates, a collapsible details widget, list-table. Enable them in your parser configuration.
  • Dependent on the implementation — for example Mermaid diagrams, a table of contents, and heading permalinks. Register the ones you want.

The :name[…] inline form and ::: name block form are always recognized. An application can register code that changes the output for a name. Without that code, the content renders as an ordinary span or div. See the optional features table.

Build your own parser

Start with Build Your Own Implementation and the Formal Grammar.

File extension: .crv

Released under the MIT License.