Serve document conversions over HTTP and CGI

weavon server drops in for pandoc-server and pandoc-server.cgi, and adds raw-byte REST endpoints, in-process PDF, health checks, and Prometheus metrics.

Verified HTTP and CGI parity

  • 99.98%Server matrix units equal
  • 25 of 25HTTP and CGI parity groups
  • 120 of 120Contract cases pass
  • 9.38 MBSingle stripped binary

Compatible routes plus fast native endpoints

Start the server as pandoc-server for strict compat mode, or run weavon server to enable raw-byte native routes with no JSON or Base64 overhead.

POST / and /batch
Full pandoc-server JSON API over HTTP and pandoc-server.cgi.
POST /v1/convert
Takes raw document bytes and returns raw output, including to=pdf.
POST /v1/diff
Computes semantic diffs and tracked-changes redlines over HTTP.
POST /v1/chunk
Returns JSON Lines RAG chunks for uploaded documents.
POST /v1/lint
Runs DocOps and accessibility checks and returns JSON or SARIF.
GET /healthz and /metrics
Readiness probe and Prometheus counters on the same port.

Convert raw bytes to PDF over HTTP

weavon server --port 3030
curl --data-binary @paper.md "http://localhost:3030/v1/convert?to=pdf" -o paper.pdf

Every request honors deadlines and cancels cleanly on server shutdown. Run dist or ghcr.io/weavon/weavon with --restart, or build with WEAVON_SOURCE=source for dist-lib HTTP 500 panic recovery.

Deploy the server

  1. Start the server

    Launch weavon server on your chosen port.

    weavon server --port 3030
  2. Convert raw bytes to PDF

    Post Markdown directly to /v1/convert?to=pdf with no Base64 wrapper.

    curl --data-binary @paper.md "http://localhost:3030/v1/convert?to=pdf" -o paper.pdf
  3. Monitor health and metrics

    Wire /healthz to your orchestrator and scrape /metrics with Prometheus.

    curl -s http://localhost:3030/healthz
    curl -s http://localhost:3030/metrics | head

Common questions

Is weavon server compatible with pandoc-server?

Yes. 25 of 25 parity groups match over both HTTP and CGI, and 67,813 of 67,828 server matrix units match Pandoc 3.13 (99.98%).

Does it support CGI mode?

Yes. Run the binary under the name pandoc-server.cgi, and it speaks the exact CGI protocol of Pandoc.

How do native /v1 routes differ from pandoc-server?

Native routes accept raw request bytes and return raw output bytes directly, avoiding JSON encoding and Base64 overhead, and support to=pdf in-process.

How do I turn off native routes for strict Pandoc parity?

Pass --compat=pandoc-3.13 or invoke the binary as pandoc-server, which disables all native routes.