carta 0.0.3

Document converter library: parse a source format and render it to a target format.
Documentation
<div align="center">

<img src="assets/logo.png" alt="carta logo" width="140" height="140">

# 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](https://pandoc.org).

[![crates.io](https://img.shields.io/crates/v/carta.svg)](https://crates.io/crates/carta)
[![docs.rs](https://img.shields.io/docsrs/carta)](https://docs.rs/carta)
[![CI](https://github.com/mfkrause/carta/actions/workflows/ci.yml/badge.svg)](https://github.com/mfkrause/carta/actions/workflows/ci.yml)
[![License: AGPL-3.0](https://img.shields.io/badge/license-AGPL--3.0-blue.svg)](LICENSE)
![MSRV](https://img.shields.io/badge/MSRV-1.93-orange.svg)

</div>

> [!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`](docs/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][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

```sh
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

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

[latest-release]: https://github.com/mfkrause/carta/releases/latest

## Usage

### Command line

```sh
# 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

```rust
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.

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

## Development

```sh
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`](LICENSE) for the full text.