File tree Expand file tree Collapse file tree
src/yetibot_kroki/commands
test/yetibot_kroki/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 (string/replace " +" " -" )
1717 (string/replace " /" " _" )))
1818
19+ (def svg-only-types
20+ #{" bpmn" " bytefield" " excalidraw" " nomnoml" " pikchr" " svgbob" " wavedrom" })
21+
1922(defn kroki-url
2023 [type graph]
21- (str " https://kroki.io/" type " /png/" (encode-for-kroki graph)))
24+ (let [format (if (contains? svg-only-types (string/lower-case type)) " svg" " png" )]
25+ (str " https://kroki.io/" type " /" format " /" (encode-for-kroki graph))))
2226
2327(defn graphviz-url
2428 [graphviz]
Original file line number Diff line number Diff line change 4545 => (str " https://kroki.io/mermaid/png/" (encode-for-kroki " graph TD; A-->B;" ))
4646
4747 (kroki-url " graphviz" " digraph G {}" )
48- => (str " https://kroki.io/graphviz/png/" (encode-for-kroki " digraph G {}" )))
48+ => (str " https://kroki.io/graphviz/png/" (encode-for-kroki " digraph G {}" ))
49+
50+ (kroki-url " excalidraw" " {\" type\" : \" excalidraw\" }" )
51+ => (str " https://kroki.io/excalidraw/svg/" (encode-for-kroki " {\" type\" : \" excalidraw\" }" ))
52+
53+ (kroki-url " BPMN" " bpmn content" )
54+ => (str " https://kroki.io/BPMN/svg/" (encode-for-kroki " bpmn content" )))
4955
5056(fact
5157 " kroki-cmd handles valid, invalid, and multiline diagrams"
You can’t perform that action at this time.
0 commit comments