Skip to content

Commit

Permalink
feat: support D2 diagrams
Browse files Browse the repository at this point in the history
Uses https://github.com/terrastruct/d2 to render https://d2lang.com
diagrams. Support was added in [email protected].

References #42.
  • Loading branch information
bauglir committed Mar 21, 2024
1 parent bc66b51 commit 134bfcd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Kroki.jl
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ DIAGRAM_TYPE_METADATA = Dict{Symbol, DiagramTypeMetadata}(
"C4 with PlantUML",
"https://github.com/plantuml-stdlib/C4-PlantUML",
),
:d2 => DiagramTypeMetadata("D2", "https://d2lang.com"),
:diagramsnet => DiagramTypeMetadata("diagrams.net", "https://diagrams.net"),
:ditaa => DiagramTypeMetadata("ditaa", "http://ditaa.sourceforge.net"),
:erd => DiagramTypeMetadata("erd", "https://github.com/BurntSushi/erd"),
Expand Down Expand Up @@ -322,8 +323,16 @@ const LIMITED_DIAGRAM_SUPPORT = MIMEToDiagramTypeMap(
:vega,
:vegalite,
),
MIME"image/svg+xml"() =>
(:bpmn, :bytefield, :excalidraw, :nomnoml, :pikchr, :svgbob, :wavedrom),
MIME"image/svg+xml"() => (
:bpmn,
:bytefield,
:d2,
:excalidraw,
:nomnoml,
:pikchr,
:svgbob,
:wavedrom
),
MIME"text/plain"() => (:c4plantuml, :plantuml, :structurizr),
MIME"text/plain; charset=utf-8"() => (:c4plantuml, :plantuml, :structurizr),
)
Expand Down

0 comments on commit 134bfcd

Please sign in to comment.