Getting started
carta reads a document in one markup format and writes it back out in another. It ships as a single binary.
Install
Section titled “Install”Download the archive for your platform from the latest release. Builds are provided for Linux (x86-64 gnu, static musl, and arm64), macOS (Intel and Apple Silicon), and Windows (x86-64).
With cargo-binstall, the matching prebuilt binary is fetched directly:
cargo binstall cartacargo install cartaThis builds every format carta supports. To build a smaller binary, see choosing formats at compile time.
git clone https://github.com/mfkrause/cartacd cartacargo build --release# binary at target/release/cartaYour first conversion
Section titled “Your first conversion”-
Convert a Markdown file to HTML:
Terminal window carta -f commonmark -t html input.md -o output.html -
Or pipe through stdin and stdout, which is what carta does when no path is given:
Terminal window echo '# Hello' | carta -f commonmark -t html -
Ask the build what it can do:
Terminal window carta --list-input-formatscarta --list-output-formatscarta --list-extensions=gfm
-f/--from and -t/--to name the source and target formats. Both accept extension toggles, so
-f markdown+hard_line_breaks-raw_html reads Pandoc Markdown with hard line breaks on and raw HTML
off.
Standalone documents
Section titled “Standalone documents”By default carta emits a document fragment. -s/--standalone wraps it in the target format's
scaffold, and the usual document switches work alongside it:
carta -f commonmark -t html -s --toc --number-sections input.md -o output.htmlChoosing formats at compile time
Section titled “Choosing formats at compile time”Each reader and writer sits behind its own Cargo feature (read-* and write-*). A build that
names only the ones you need carries neither the code nor the dependencies of the rest:
cargo install carta --no-default-features --features cli,read-commonmark,write-htmlThe full feature, on by default, turns on every format.
