Skip to content

Export backends: PlantUML, TikZ, Typst #15

Open

Description

@clintecker

Follow DOTExporter (shipped in v1.3.0) with more export targets, so MermaidKit converts out to other ecosystems.

Two targeting strategies (from the export-substrate research)

  • Structural (targets the pre-layout Flowchart/MermaidDiagram IR — re-emit ids/shapes/edges/subgraphs, let their engine lay out):
    • PlantUML — deployment-style shapes map cleanly (rectangle/diamond/database/hexagon are keywords).
  • Geometric (targets the placed *Layout — emit MermaidKit's absolute coordinates so the output reproduces our layout, mirroring DiagramRenderer.draw(_ layout:)):
    • TikZ — \node[draw,<shape>] at (x,y); academic/LaTeX use.
    • Typst (CeTZ) — same geometric approach, y-flipped canvas.

Notes

  • DiagramScene drops shape/color, so geometric exporters must consume the per-type *Layout (which carries shape/dashed/hasArrow/colorIndex), not the scene.
  • DOTExporter is the template for structure + round-trip testing; the raster DiagramRenderer.draw(_ layout:) is the template for geometric emit.
  • Also worth considering: SVG (platform-free, the biggest real gap — unlocks web output without a rasterizer) — arguably its own issue/higher priority.

Activity

  1. clintecker commented on Jul 18, 2026

    @clintecker
    CollaboratorAuthor

    SVG export shipped in v1.4.0 — MermaidRenderer.svg(source:theme:) renders all 30 diagram types to standalone SVG via the new platform-free RenderScene IR + SVGRenderer. That was the flagged higher-priority item in this issue.

    Remaining scope here: PlantUML (structural, from the pre-layout IR) and TikZ / Typst (geometric, from RenderScene — which now exists and makes these much easier: emit the scene's shapes/paths/text as TikZ/CeTZ primitives). DOT export already shipped in v1.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions