Search by

markup-carve / carve-php

dereuromark

PHP parser for Carve, a lightweight markup language for documents and the web.

Package info

github.com/markup-carve/carve-php

Homepage

pkg:composer/markup-carve/carve-php

Fund package maintenance!

dereuromark

Statistics

Installs: 7 790

Dependents: 9

Suggesters: 0

Stars: 6

Open Issues: 1

0.1.10 2026-09-29 22:40 UTC

README

CI Coverage Latest Stable Version Total Downloads PHPStan PHP Version Software License

PHP parser and renderer for Carve, a lightweight markup language for readable source and structured documents.

Implements Carve spec 0.1 (see Versioning & Changelog).

Installation

composer require markup-carve/carve-php

HTML import and HTML heading-ID conversion require the PHP DOM extension (ext-dom). Core Carve parsing and rendering do not require it.

Usage

use MarkupCarve\Carve\CarveConverter;

$converter = new CarveConverter();
$html = $converter->convert('# Hello /Carve/');

The converter also renders Markdown, plain text and ANSI. PHP integration options are in the PHP guides.

CLI

vendor/bin/carve README.crv > README.html   # render (HTML by default)
vendor/bin/carve --markdown README.crv      # or --plain, --ansi, --json
vendor/bin/carve lint README.crv            # report problems, change nothing
vendor/bin/carve migrate --from html p.html # convert into Carve

See the CLI guide for all subcommands and flags.

Sandbox

Try this implementation live in the Carve sandbox - explore syntax and extensions, inspect output, and share snippets via pastebin-style links. It also powers the wp-carve WordPress plugin.

Untrusted input

Use the safe rendering options for untrusted documents. They disable raw HTML passthrough and bound nesting depth.

Documentation

Table body partitions and source attributes are documented in Table source metadata.