# Weavon complete reference > Weavon is a document converter in Rust that is compatible with Pandoc 3.13. This file describes version 0.1.0. Weavon is free software under the MIT licence or the Apache License 2.0. The source is at https://github.com/weavon/weavon and the website is at https://weavon.github.io/weavon/. Weavon is not affiliated with the Pandoc project. The facts in this file are the measurements of the v0.1.0 release. ## What Weavon is Weavon reads and writes the formats of Pandoc 3.13, and it accepts the same command-line options. For most documents, its output is equal to the output of Pandoc 3.13, byte for byte. It is a clean-room implementation, and the project rules forbid reading the Haskell source of Pandoc. The behaviour comes from the Pandoc manual, documented interfaces, and the output of Pandoc 3.13 as a black box. Pandoc runs only in the test tools. ## Measured compatibility These results were measured for Weavon v0.1.0 on 2026-11-30. Equal means the same output, the same warnings, and the same exit code. - In the conformance harness, 65,891 of 65,937 units are equal (99.93%). 65,776 units are byte-identical, 420 units are skipped, 46 units differ on purpose, and 0 units regress. Each deliberate unit has a GPL data part or an oracle crash. - 50 of 52 input formats pass. The partial ones are json, mdoc. - 75 of 77 output formats pass. The partial ones are json, and pdf has no oracle comparison, because PDF needs an external engine. - 90 of 90 extensions pass. - 99 of 109 options pass. The partial ones are bibliography, epub-cover-image, epub-embed-font, log, output, reference-doc, sandbox, syntax-definition, toc, and the ones that do not apply are bash-completion. - 2,228 of 2,231 Pandoc 3.13 test suite tests pass. The 3 failures are the shell completion tests, because the Pandoc scripts are GPL text. - 690 of 690 real-document conversions are equal, over 230 open-licence documents and the 3 output formats html, json, and markdown. - 120 of 120 server contract cases pass, and 25 of 25 parity groups are equal over HTTP and CGI (50 of 50 checks). The full server matrix has 67,813 of 67,828 equal units, and the 15 other units are deliberate. - I-JSON-01 covers 6 units. The oracle crashes in the Haskell library scientific on extreme JSON integer exponents. - I-SERVER-04 covers 8 units. The server nesting limit of Weavon stops input that Pandoc reads without a limit. - I-CLI-09 covers 1 units. The version text names Weavon. - 468 of 468 Pandoc 3.13 Lua API names match. - Syntax highlighting covers all 194 of 194 Pandoc 3.13 built-in languages using 62 KDE language definitions (plus the shared Alerts helper) and 132 clean-room Rust definitions embedded in `clean-syntaxes.zlib`, with 0 differences across 13,986 replay cases. The input formats are asciidoc, biblatex, bibtex, bits, commonmark, commonmark_x, creole, csljson, csv, djot, docbook, docx, dokuwiki, endnotexml, epub, fb2, fodt, gfm, haddock, html, ipynb, jats, jira, json, latex, man, markdown, markdown_github, markdown_mmd, markdown_phpextra, markdown_strict, mdoc, mediawiki, muse, native, odt, opml, org, pod, pptx, ris, rst, rtf, t2t, textile, tikiwiki, tsv, twiki, typst, vimwiki, xlsx, xml. The output formats are ansi, asciidoc, asciidoc_legacy, asciidoctor, bbcode, bbcode_fluxbb, bbcode_hubzilla, bbcode_phpbb, bbcode_steam, bbcode_xenforo, beamer, biblatex, bibtex, chunkedhtml, commonmark, commonmark_x, context, csljson, djot, docbook, docbook4, docbook5, docx, dokuwiki, dzslides, epub, epub2, epub3, fb2, fodt, gfm, haddock, html, html4, html5, icml, ipynb, jats, jats_archiving, jats_articleauthoring, jats_publishing, jira, json, latex, man, markdown, markdown_github, markdown_mmd, markdown_phpextra, markdown_strict, markua, mediawiki, ms, muse, native, odt, opendocument, opml, org, pdf, plain, pptx, revealjs, rst, rtf, s5, slideous, slidy, t2t, tei, texinfo, textile, typst, vimdoc, xml, xwiki, zimwiki. ## Differences from Pandoc that a user can see - Default citation style. The built-in style and locales are Weavon's own work. Some citations can differ from Pandoc's default.csl. To work around it, use `--csl` with the style that you need. - DOCX, ODT, FODT, and PPTX styles. Weavon writes its own default styles, because the reference documents of Pandoc are GPL. The output bytes differ. To work around it, use `--reference-doc` with your reference document. - EPUB stylesheet. Weavon uses its own default stylesheet. To work around it, use `--css`. - Translated labels. Weavon has its own labels (for example Abstract) for 107 language tags. Some labels differ from Pandoc. To work around it, put translation files in `DATADIR/translations/`. - Syntax highlighting. Weavon highlights all 194 built-in Pandoc 3.13 languages using 62 KDE language definitions (plus the shared Alerts helper) and 132 clean-room Rust definitions, with 0 differences across 13,986 replay cases. To work around it, use `--syntax-definition FILE.xml` to add custom languages. - `--print-default-data-file`. Templates and some built-in data are available. Pandoc translation files are not. To work around it, get other files from the Pandoc distribution. - Shell completion. Weavon makes its own completion scripts. - Limits. Weavon stops with an error at limits for nesting depth, input size, table size, and archive size. Pandoc can use all memory or run without end on such input. - Error messages. Weavon does not print the Haskell call stack lines of Pandoc. Some JSON and YAML error texts differ. ## Compat mode and native mode - Compat mode starts when you run the program as pandoc through a link, or when you give --compat=pandoc-3.13. Weavon then behaves as Pandoc 3.13 and the native features are off. Compat mode reads no configuration file and makes no network request that Pandoc would not make. - Native mode starts when you run the program as weavon. Weavon accepts the same command line and adds native workflows. Each native extension has the prefix x_. ## Native subcommands and features - weavon build and --output-dir convert many files in parallel with -j N, and weavon watch converts again when an input changes. - weavon.yaml is a project file with named profiles that you pick with --profile NAME. --print-config prints each value and its origin. Keys that run programs or write files apply only from a trusted file with --trust-config, and x_include includes other files inside the project root. - weavon diff OLD NEW is a semantic diff, block by block and word by word. It writes Word tracked changes (DOCX), CriticMarkup, HTML with ins and del, Markdown, JSON, or a PDF redline. - weavon chunk writes JSON Lines chunks for RAG, with heading_path, markdown, token_estimate, char_count, block_start, and block_end. --max-tokens N sets the size. - weavon lint checks 10 accessibility and DocOps rules and writes human text, JSON, or SARIF 2.1.0, which you pick with --diagnostics=human, --diagnostics=json, or --diagnostics=sarif. - weavon fmt formats Markdown and refuses output whose document tree differs from the input, and weavon fmt --check fails on unformatted files. - weavon inspect prints the format, the extensions, and the tree, and weavon doctor checks the environment. - --main-content, --clean, --base-url, and -t llm-markdown make clean Markdown from HTML for LLMs, and --emit-llms-txt writes llms.txt and llms-full.txt for a batch. - -f obsidian reads callouts, alerts, embeds, block references, and tags. The writers docusaurus-mdx, mkdocs-md, hugo-md, starlight-md, and myst-md write static site dialects. - x_crossref numbers figures, tables, equations, listings, and sections, and x_diagrams draws Mermaid, Graphviz DOT, and D2 as SVG in pure Rust. - --resolve-citations=lockfile resolves doi, arxiv, pmid, and isbn keys from weavon-citations.lock.json with no network request. - --math-svg writes TeX math as SVG in HTML, with no MathJax. - With SOURCE_DATE_EPOCH set, DOCX, EPUB, ODT, PPTX, and embedded PDF output is byte-identical. - weavon server is compatible with pandoc-server, and it adds GET /healthz, GET /metrics for Prometheus, and POST /v1/convert, /v1/diff, /v1/chunk, and /v1/lint with raw bytes. ## Embedded PDF engine --pdf-engine=embedded writes PDF 1.7 directly from the document tree, in pure Rust with no unsafe code. It needs no TeX Live and runs no external program, so it works with --sandbox and with an empty PATH. The PDF has bookmarks (/Outlines), links, tables, code blocks, callouts, and footnotes. The engine embeds JPEG and PNG images and tags each PDF for PDF/UA with alt text for figures. With SOURCE_DATE_EPOCH set, the bytes are the same on each run. The engine uses the standard PDF fonts, so it writes Latin text only, in the WinAnsi character set. Raw LaTeX gives the warning W_PDF_UNSUPPORTED_RAW_LATEX. For other text and for raw LaTeX, use an external engine such as --pdf-engine=lualatex. In compat mode, Weavon uses the 15 external engines of --pdf-engine. ## PDF reader The opt-in Cargo feature reader-pdf reads born-digital PDF in native mode. A tagged PDF gives its blocks from the structure tree, and an untagged page gives headings, paragraphs, lists, and tables from the layout. The reader does no OCR. A page with images and no text goes to a PdfPageFallback hook, or gives the warning W_PDF_SCANNED_PAGE_NEEDS_OCR. ## Bindings and embedding - Rust uses the weavon crate, with one Cargo feature for each group of formats, for example format-markdown. PolicyHost limits the files, URL hosts, and programs that a conversion can use. - The C ABI is the weavon-c crate with `include/weavon.h`, for conversion (also PDF), diff, chunks, and lint. Each call runs in a sandbox with no files, no network, and no processes, with input and output limits of 64 MiB. - Python installs from PyPI with `pip install weavon`. Prebuilt wheels bundle `libweavon_c` (built with `dist-lib` so `panic = "unwind"` catches panics without aborting the host process) and call the C ABI through `ctypes` with zero third-party dependencies. For a source build, run `cargo build -p weavon-c --profile dist-lib` and `pip install ./bindings/python`, and set `WEAVON_LIB_PATH`. - Node.js installs from npm with `npm install weavon`, bundling the `dist` WebAssembly module (`weavon_wasm.wasm`) with TypeScript types and zero npm dependencies on Node.js 22 or later. A panic traps inside the WebAssembly instance while the Node process continues, and the Vite plugin resets automatically. For a source build, run `cargo build -p weavon-wasm --target wasm32-unknown-unknown --profile dist --features pdf` and `npm install ./bindings/node`. - Both bindings run in the process with no subprocess, and they give a typed Pandoc AST and a walk function for filters in the host language. ## WebAssembly The weavon-wasm crate builds a browser module with an ES module wrapper in `crates/weavon-wasm/js/weavon.mjs`, and it needs no npm package. The operations are convert, convertBytes, diff, chunk, lint, sniffFormat, and version, and each call runs in a sandbox. With the dist profile, the core bundle for Markdown and HTML is 4,415,781 bytes raw (4.21 MiB) and 1,952,445 bytes (1.86 MiB) gzipped, and converts 100 KB Markdown to HTML in 9.62 ms and 100 KB CommonMark to HTML in 6.48 ms in Node.js v22.23.2. Adding `--features pdf` (PDF writer and PDF reader) gives 4,899,614 bytes raw (4.67 MiB) and 2,133,909 bytes (2.04 MiB) gzipped. With `dist-wasm`, the core bundle shrinks to 1,798,658 bytes (1.72 MiB) gzipped at 1.42 times slower speed. The playground at https://weavon.github.io/weavon/playground.html runs it. ## Benchmarks On 1 MB inputs and 106 KB DOCX on a quiet Apple M1, Weavon is 11.3 to 46.1 times faster than Pandoc 3.13 in wall time (16.8 to 46.1 times on conversions) and uses 4.2 to 17.5 times less peak RSS. This table gives the wall time of the command-line program on a MacBookPro17,1, Apple M1, 16 GiB memory, quiet machine (load average 3.15 to 2.25) with macOS 27.0.1 (arm64), measured on 2026-12-02. Each time is the minimum of 21 interleaved `posix_spawn` runs (3 runs for Pandoc 3.13), and the output is byte-equal to Pandoc 3.13 in all 11 conversion cases. | Conversion | Weavon | Pandoc 3.13 | Speedup | Weavon peak RSS | Pandoc peak RSS | | --- | ---: | ---: | ---: | ---: | ---: | | Startup (--version) | 2.6 ms | 29.9 ms | 11.3x | 2.5 MiB | 36.7 MiB | | CommonMark to JSON | 23.9 ms | 718.3 ms | 30.1x | 36.9 MiB | 229.3 MiB | | HTML to JSON | 18.2 ms | 721.4 ms | 39.7x | 21.3 MiB | 373.2 MiB | | JSON to JSON | 6.0 ms | 122.2 ms | 20.3x | 10.1 MiB | 141.4 MiB | | JSON to HTML | 10.1 ms | 232.9 ms | 23.2x | 10.8 MiB | 155.0 MiB | | JSON to HTML, no highlighting | 7.9 ms | 188.4 ms | 23.9x | 10.0 MiB | 149.3 MiB | | JSON to LaTeX | 12.5 ms | 211.2 ms | 16.8x | 10.8 MiB | 153.7 MiB | | JSON to LaTeX, no highlighting | 10.4 ms | 190.9 ms | 18.4x | 10.2 MiB | 151.9 MiB | | Markdown to HTML | 53.6 ms | 2,264.4 ms | 42.2x | 29.2 MiB | 262.2 MiB | | Markdown to HTML, no highlighting | 44.7 ms | 2,063.5 ms | 46.1x | 28.2 MiB | 249.5 MiB | | LaTeX to JSON | 22.0 ms | 559.5 ms | 25.4x | 36.4 MiB | 152.5 MiB | | DOCX (106 KB) to JSON | 51.3 ms | 1,747.2 ms | 34.1x | 32.9 MiB | 463.2 MiB | This table gives the CPU time of release 0.1.0, measured on 2026-11-30. | Measurement | Weavon | Pandoc | Weavon to Pandoc ratio | | --- | ---: | ---: | ---: | | Startup, --version, median CPU | 2.73 ms | 18.36 ms | 0.149 | | Startup, empty Markdown to HTML, median CPU | 3.33 ms | 19.19 ms | 0.173 | | Markdown to HTML, 1.29 MB input, median CPU | 556.6 ms | 3,103.1 ms | 0.179 | | JSON to HTML, 8.19 MB input, median CPU | 245.9 ms | 1,686.7 ms | 0.143 | | Corpus, 690 conversions in sequence, CPU | 5.82 s | 73.73 s | 0.079 | | Corpus, median peak memory of one conversion | 7.2 MiB | 109.3 MiB | 0.065 | The stripped Weavon `dist` ARM64 binary is 9,377,504 bytes (9.38 MB, 8.94 MiB), and the shipped ARM64 binary before `strip` is 9,432,128 bytes (9.43 MB). The stripped binary is 20.8 times smaller than Pandoc 3.13 (195,352,064 bytes, 186.30 MiB), 18.6% smaller than Carta 0.0.16 binary alone (11,523,152 bytes, 11.52 MB), and 42.7% smaller than Carta plus its required 4.85 MB `syntax/` directory (16,372,808 bytes, 16.37 MB). ## Comparison with Carta and ferrodoc On 2026-12-02, Weavon, Carta 0.0.16, ferrodoc 1.0.1, and Pandoc 3.13 ran in one quiet session on the same Apple M1. Each cell gives the minimum wall time across 21 interleaved `posix_spawn` runs, peak RSS from `/usr/bin/time -l` (with 5-run interleaved medians confirming the three tightest memory cases), and whether the output has the same bytes as Pandoc 3.13. Measured on a quiet machine with load average 3.15 at start and 2.25 at end. Weavon beat Carta 0.0.16 in all 11 cases (1.13x to 1.77x faster default, 1.22x to 1.67x with `--mathml`, 1.04x to 3.66x lower peak RSS) and beat ferrodoc 1.0.1 in all 10 supported cases (1.20x to 3.82x faster, 1.04x to 3.00x lower peak RSS). Weavon wrote the same bytes as Pandoc in all 11 cases, Carta in 4, and ferrodoc in 3. | Conversion | Weavon 0.1.0 | Carta 0.0.16 | ferrodoc 1.0.1 | Pandoc 3.13 | | --- | --- | --- | --- | --- | | CommonMark to JSON, 1 MB | 23.9 ms, 36.9 MiB, same bytes | 32.5 ms, 49.6 MiB, same bytes | 37.5 ms, 47.2 MiB, differs | 718.3 ms, 229.3 MiB, reference | | HTML to JSON, 1 MB | 18.2 ms, 21.3 MiB, same bytes | 23.4 ms, 39.7 MiB, differs | 43.0 ms, 38.1 MiB, differs | 721.4 ms, 373.2 MiB, reference | | JSON to JSON, 1 MB | 6.0 ms, 10.1 MiB, same bytes | 8.4 ms, 11.3 MiB, same bytes | 10.7 ms, 11.2 MiB, same bytes | 122.2 ms, 141.4 MiB, reference | | JSON to HTML, 1 MB | 10.1 ms, 10.8 MiB, same bytes | 16.5 ms, 15.4 MiB, differs | 31.4 ms, 14.9 MiB, differs | 232.9 ms, 155 MiB, reference | | JSON to HTML, no highlighting, 1 MB | 7.9 ms, 10 MiB, same bytes | 9.6 ms, 11.7 MiB, differs | 28.0 ms, 14.6 MiB, differs | 188.4 ms, 149.3 MiB, reference | | JSON to LaTeX, 1 MB | 12.5 ms, 10.8 MiB, same bytes | 18.9 ms, 15.7 MiB, same bytes | 15.0 ms, 11.2 MiB, same bytes | 211.2 ms, 153.7 MiB, reference | | JSON to LaTeX, no highlighting, 1 MB | 10.4 ms, 10.2 MiB, same bytes | 11.7 ms, 12.2 MiB, same bytes | 14.5 ms, 10.9 MiB, same bytes | 190.9 ms, 151.9 MiB, reference | | Markdown to HTML, 1 MB | 53.6 ms, 29.2 MiB, same bytes | 77.7 ms, 54.6 MiB, differs | 192.7 ms, 82.9 MiB, differs | 2,264.4 ms, 262.2 MiB, reference | | Markdown to HTML, no highlighting, 1 MB | 44.7 ms, 28.2 MiB, same bytes | 60.4 ms, 51.2 MiB, differs | 170.8 ms, 84.5 MiB, differs | 2,063.5 ms, 249.5 MiB, reference | | LaTeX to JSON, 1 MB | 22.0 ms, 36.4 MiB, same bytes | 38.6 ms, 38 MiB, differs | not run | 559.5 ms, 152.5 MiB, reference | | DOCX to JSON, 106 KB | 51.3 ms, 32.9 MiB, same bytes | 90.5 ms, 120.3 MiB, differs | 115.1 ms, 55.7 MiB, differs | 1,747.2 ms, 463.2 MiB, reference | ## Safety Weavon treats each input as untrusted. Readers stop at limits, and they never stop the program with a panic. The `dist` CLI and the published `ghcr.io/weavon/weavon` container image build with `panic = "abort"` (exit code 62 on internal error, so run long-lived servers with `--restart` or behind a supervisor). The `dist-lib` profile keeps `panic = "unwind"` for the C ABI, Python bindings, and source-built Docker images (`docker build --build-arg WEAVON_SOURCE=source .`). The Node bindings run the `dist` WebAssembly module, where a panic traps inside the WebAssembly instance while the Node process continues, and the Vite plugin resets automatically. For production `weavon server`, run the `dist` binary behind a supervisor for fail-fast restarts, or build with `--profile dist-lib` or `--release` for in-process `catch_unwind` HTTP 500 recovery. The Rust code forbids unsafe code, with audited exceptions in weavon-lua for two calls to the Lua C interface and in weavon-c for C pointers. --sandbox restricts file and network access, as in Pandoc. The HTML writer is not a sanitizer. ## Install - On macOS and Linux, run `curl -fsSL https://weavon.github.io/weavon/install.sh | sh`. - For a drop-in Pandoc, run `curl -fsSL https://weavon.github.io/weavon/install.sh | sh -s -- --as-pandoc`. - In Windows PowerShell, run `irm https://weavon.github.io/weavon/install.ps1 | iex`. - With Homebrew, run `brew install weavon/tap/weavon`. - With Scoop, run `scoop bucket add weavon https://github.com/weavon/scoop-bucket` and then `scoop install weavon/weavon`. - With Cargo, run `cargo binstall --git https://github.com/weavon/weavon weavon-cli`, or without cargo-binstall run `cargo install --locked --git https://github.com/weavon/weavon weavon-cli`. - In GitHub Actions, add the step `uses: weavon/weavon@v0.1.0` with the input `as-pandoc: true`. - With Docker, run the image `ghcr.io/weavon/weavon`, which also has a pandoc command. - With pre-commit, add the repository https://github.com/weavon/weavon at rev v0.1.0 with the hooks weavon-lint and weavon-fmt. - The VS Code extension is in `plugins/vscode`, and the Neovim plugin is in `plugins/weavon.nvim`. - To build from source, run `git clone https://github.com/weavon/weavon` and then `cargo build --release -p weavon-cli`. You need Rust 1.99 or later and a C compiler. - Prebuilt programs for macOS (arm64 and x86_64), Linux (x86_64 and arm64), and Windows (x86_64) are on https://github.com/weavon/weavon/releases under the v0.1.0 tag, and the installers download them from there. - To use Weavon as pandoc, run `ln -s "$(command -v weavon)" ~/.local/bin/pandoc`. Under the name pandoc, the first line of --version is "pandoc 3.13" and the second line names Weavon.