Renderings
Artifacts render differently depending on context. In the artifact viewer, diagram fences render as live SVG in the browser. In a PDF export, a headless Chromium instance (Gotenberg) captures the same content, with diagrams pre-rendered server-side before the page is printed.
In-app diagram preview
The artifact viewer renders PlantUML and Mermaid diagram fences directly in the browser as you read. No action is required; the diagrams appear where the fenced code blocks are in the document.
How exports render diagrams
When you request a PDF export of a text artifact, the server runs two rendering pipelines concurrently before handing the document to Gotenberg.
PlantUML fences are sent to the plantuml-server container. Short sources use a GET request to /svg/<encoded>; sources whose encoded form exceeds the size limit use POST /svg. Both return SVG, which is inlined as a data-URI <img> element.
Mermaid fences are passed in a single subprocess call to the Mermaid validator script. A { "diagrams": [...] } payload triggers render mode; the script returns per-diagram SVG results. The two pipelines (PlantUML per-diagram HTTP and Mermaid one-shot subprocess) run concurrently.
Fallback behavior
When a diagram cannot be rendered (the plantuml-server is unavailable, the Mermaid subprocess fails, or the diagram source is invalid), the fence appears in the export as a labelled dashed box. The label names the language and notes that the diagram renders in the platform. This makes it clear the content is intentional diagram source, not broken output.
Failures fall open: a missing renderer leaves every affected fence unchanged rather than failing the export.
Canvas artifact exports
Canvas artifacts (designs, decks, wireframes) do not go through the diagram pipeline. Their stored HTML pages are captured directly by Gotenberg using a full-page screenshot or PDF conversion. The result is a faithful render of the design canvas.