Render a drawspec document to SVG, PNG or text
renderConvert a drawspec JSON document to SVG, PNG, or plain text for inline Markdown, chat, slides, or terminals, returning located violations when validation fails.
Instructions
Draw the document and return the SVG. The output is safe to paste inline into a Markdown page: no global styles, no colliding ids, and no meaning carried by colour alone. With format png it returns a PNG image instead, for a chat, a slide or an attachment (needs the server's drawspec[png] extra); with format text, the diagram as plain text, for the kinds that have a text form. Refuses with located violations exactly as validate does.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scale | No | png only: pixels per SVG unit (default 2). | |
| theme | No | A bundled theme name or a path to a theme file. Omit for the default. | |
| width | No | Override the document's width. With format `text`, the most terminal cells a line may take (default 80, or 100 for `lanes` and `sequence`). | |
| format | No | svg (default), png, or text: the diagram as plain text for a code block or a terminal, for the kinds files, tree, sequence, gantt, timeline, board, stack, rag, meter, flow, states, lanes. | |
| height | No | Override the document's height. | |
| charset | No | text only: box-drawing characters, or ASCII only (default unicode). | |
| document | Yes | A drawspec document, as JSON. The full field list is published at https://nuncaeslupus.github.io/drawspec/schema/drawspec-v1.schema.json, and `kinds` names the 36 values `kind` may take. | |
| background | No | png only: the page the drawing is on (default light). |