Skip to content

mfkrause/carta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

571 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
carta logo

carta

A universal document converter written in Rust. Read a markup format, render it back out in another. A performant and lightweight reimplementation of pandoc.

crates.io docs.rs CI License: AGPL-3.0 MSRV

Warning

carta is an early-stage alpha under active development. Not all of pandoc's formats are implemented yet and the API is still unstable.

Goals

  • Performance and a smaller binary than pandoc.
  • Feature parity with pandoc across all formats and extensions.
  • A developer-friendly library, with the CLI as a thin shell over it.

Status

This tracks carta's status of all formats pandoc supports. See STATUS.md for a detailed per-format breakdown including extension coverage, and the full feature backlog.

βœ… usable β€” basically done; any remaining parity gaps are minor and unlikely to affect regular use Β· 🚧 in development β€” large parity gaps or breaking issues (e.g. panics), not recommended for use yet Β· ❌ not started Β· βž– not applicable (pandoc has no such direction)

Markdown family

Format Reader Writer
CommonMark (commonmark) βœ… βœ…
CommonMark-X (commonmark_x) βœ… βœ…
GitHub-Flavored Markdown (gfm) βœ… βœ…
Pandoc Markdown (markdown) βœ… βœ…
Markdown strict (markdown_strict) βœ… βœ…
MultiMarkdown (markdown_mmd) βœ… βœ…
PHP Markdown Extra (markdown_phpextra) βœ… βœ…
GitHub Markdown, legacy (markdown_github) βœ… βœ…
Djot (djot) ❌ ❌
Markua (markua) βž– ❌

HTML & slides

Format Reader Writer
HTML (html, html5, html4) βœ… βœ…
Chunked HTML (chunkedhtml) βž– ❌
reveal.js (revealjs) βž– βœ…
Beamer (beamer) βž– βœ…
Slidy (slidy) βž– ❌
S5 (s5) βž– ❌
Slideous (slideous) βž– ❌
DZSlides (dzslides) βž– ❌
PowerPoint (pptx) ❌ ❌

TeX & typesetting

Format Reader Writer
LaTeX (latex) βœ… βœ…
Typst (typst) ❌ βœ…
ConTeXt (context) βž– ❌
Texinfo (texinfo) βž– ❌
PDF (pdf) βž– ❌

Lightweight markup

Format Reader Writer
reStructuredText (rst) βœ… βœ…
AsciiDoc (asciidoc) ❌ βœ…
AsciiDoc legacy (asciidoc_legacy) βž– ❌
Asciidoctor (asciidoctor) βž– ❌
Org mode (org) βœ… βœ…
Textile (textile) ❌ ❌
Muse (muse) ❌ ❌
Haddock (haddock) ❌ ❌
txt2tags (t2t) ❌ βž–
Perl POD (pod) ❌ βž–

Wikis

Format Reader Writer
MediaWiki (mediawiki) βœ… βœ…
DokuWiki (dokuwiki) βœ… βœ…
Jira (jira) βœ… βœ…
Creole (creole) ❌ βž–
TikiWiki (tikiwiki) ❌ βž–
TWiki (twiki) ❌ βž–
Vimwiki (vimwiki) ❌ βž–
XWiki (xwiki) βž– ❌
ZimWiki (zimwiki) βž– ❌

roff

Format Reader Writer
man (man) βœ… βœ…
mdoc (mdoc) ❌ βž–
ms (ms) βž– ❌
vimdoc (vimdoc) βž– ❌

Word processor, ebook & notebook

Format Reader Writer
Word (docx) ❌ ❌
OpenDocument Text (odt) ❌ ❌
OpenDocument (opendocument) βž– ❌
EPUB (epub, epub2, epub3) ❌ βœ…
Jupyter Notebook (ipynb) βœ… βœ…
FictionBook2 (fb2) ❌ ❌
InDesign ICML (icml) βž– ❌
Rich Text Format (rtf) ❌ ❌
Spreadsheet (xlsx) ❌ βž–

XML & publishing

Format Reader Writer
DocBook (docbook, docbook4, docbook5) ❌ ❌
JATS (jats, jats_archiving, jats_articleauthoring, jats_publishing) ❌ ❌
BITS (bits) ❌ βž–
TEI (tei) βž– ❌
Generic XML (xml) ❌ ❌

Bibliography

Format Reader Writer
BibTeX (bibtex) ❌ ❌
BibLaTeX (biblatex) ❌ ❌
CSL JSON (csljson) ❌ ❌
RIS (ris) ❌ βž–
EndNote XML (endnotexml) ❌ βž–

Data, interchange & terminal

Format Reader Writer
Pandoc JSON (json) βœ… βœ…
Native Pandoc AST (native) βœ… βœ…
OPML (opml) βœ… βœ…
CSV (csv) βœ… βž–
TSV (tsv) βœ… βž–
Plain text (plain) βž– βœ…
BBCode (bbcode, bbcode_phpbb, bbcode_steam, …) βž– ❌
ANSI terminal (ansi) βž– ❌

Installation

Prebuilt binaries

Download the archive for your platform from the latest release. Builds are provided for Linux (x86-64 gnu and static musl, arm64), macOS (Intel and Apple Silicon), and Windows (x86-64).

From crates.io

cargo install carta

This installs the carta binary. For a smaller build, pass --no-default-features with only the formats you need, e.g. --features cli,read-commonmark,write-html.

From source

git clone https://github.com/mfkrause/carta
cd carta
cargo build --release
# binary at target/release/carta

Usage

Command line

# CommonMark to HTML
carta -f commonmark -t html input.md -o output.html

# read from stdin, write to stdout
echo '# Hello' | carta -f commonmark -t html

# inspect the document model
carta -f commonmark -t json input.md

# standalone document with a table of contents and numbered sections
carta -f commonmark -t html -s --toc --number-sections input.md -o output.html

# render HTML math with MathJax (or --katex)
carta -f commonmark -t html -s --mathjax input.md -o output.html

# extract a notebook's embedded images to files, rewriting the references
carta -f ipynb -t markdown --extract-media=media notebook.ipynb -o notebook.md

# transform the document through a JSON filter before writing (repeatable, applied in order)
carta -f commonmark -t html -F ./my-filter.py input.md -o output.html

# discover what this build supports
carta --list-input-formats
carta --list-output-formats
carta --list-extensions          # extensions for the Markdown dialect
carta --list-extensions=gfm      # extensions and defaults for a given format

Library

use carta::{convert_text, ReaderOptions, WriterOptions};

let html = convert_text(
    "commonmark",
    "html",
    "# Hello, *world*",
    &ReaderOptions::default(),
    &WriterOptions::default(),
)?;

convert_text is the shortcut for text-to-text conversion. The general entry point is convert, which takes raw bytes and returns an Output that is text or bytes depending on the target format β€” use it when either side is a binary format.

You can select formats at compile time via per-direction features to make binaries even more lightweight for your individual needs.

cargo build -p carta --no-default-features --features read-commonmark,write-html

Development

cargo build                         # build the workspace
cargo nextest run --workspace       # run tests
cargo clippy --all-targets          # lint
cargo +nightly fuzz run commonmark  # fuzz a reader (see fuzz/README.md)

The workspace splits into carta-ast (the document model), carta-core (shared traits and options), carta-readers, carta-writers, and carta (the library facade, which also ships the command-line binary behind its cli feature).

License

Copyright Β© 2026 Maximilian Krause.

carta is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. See LICENSE for the full text.

About

πŸ“œ A fast universal markup converter written in Rust

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors