Enables a wide array of textual diagramming tools, such as Graphviz, Mermaid, PlantUML, svgbob and many more within Julia through the Kroki service. It works in environments capable of rendering images:
and even in the REPL for a subset of the supported diagrams:
See the documentation for more information and please follow the contribution guidelines when contributing.
Install Kroki through Julia's package manager
(v1.10) pkg> add Kroki
Construct diagrams using the
Diagram
type
or any of the available string
literals. Then
either rely on the available Base.show
overloads, or call the
render
function with a specific output format, to visualize them.
julia> using Kroki
julia> plantuml"""
Kroki -> Julia: Hello!
Julia -> Kroki: Hi!
Kroki -> Julia: Can I draw some diagrams for you?
Julia -> Kroki: Sure!
"""
┌─────┐ ┌─────┐
│Kroki│ │Julia│
└──┬──┘ └──┬──┘
│ Hello! │
│─────────────────────────────────>│
│ │
│ Hi! │
│<─────────────────────────────────│
│ │
│Can I draw some diagrams for you? │
│─────────────────────────────────>│
│ │
│ Sure! │
│<─────────────────────────────────│
┌──┴──┐ ┌──┴──┐
│Kroki│ │Julia│
└─────┘ └─────┘
Note: ASCII art diagrams, as shown above, are only supported for a subset of PlantUML diagrams. All other diagram types are better supported in environments like Documenter.jl, Pluto.jl or Jupyter.