New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Kroki support #6680
base: main
Are you sure you want to change the base?
Add Kroki support #6680
Conversation
Hi, this is very interesting – thanks for the contribution. I have a couple of concerns, I'm sure they may be alleviated though…
|
Since we can self-host Korki, I'm personally fine with running an extra service for this, it can just acts as another dependency like redis/MySQL. On the side of rendering speed, already-created diagrams will be cached by browser, though it will be slower when editing the diagram, I think it's a acceptable trade-off. I don't have strong opinion on replacing mermaid.js by kroki, just thinking this might make upgrading mermaid.js more easily. Also IMO mermaid.js is already a third party component, so I guess the real difference is switching from client-side to server-side rendering.
That is true. I don't use diagrams other than plantuml so much. I think one possible design is merge all Kroki diagrams as a single language, than add some custom instruction/syntax to choose the specific diagram, for example:
Or maybe making a new variant of CodeBlock for Kroki with a separate language list for diagram types? |
I just made some UI changes to improve this one: |
Thanks – this is a reasonable solution that I'm onboard with, unfortunately it does make this PR another one that's dependent on #3000 as the |
ok, I guess I can just remove the use of |
I don't think it's preferable, it is best to have this dependent on #3000 which is top of the roadmap to complete right now, so should be done soon |
Got it, it seems there isn't much I can do until #3000 get done. Thanks for your time & considering this approach :) |
Hi,
This patch is my attempt to support Kroki diagram(and fixes #4242).
It is basically a clone of Mermaid Node with some modifications.
isDark
removed since Kroki doesn't support it.kroki_${DIAGRAM}
are used to choose different Kroki diagrams.Integration
url to aNode
, sourl
of the Kroki instance is hard-coded tohttps://kroki.io
now.Mermaid.js
is also supported by Kroki too, so it might able to replace current mermaid.js implementation.Cache
since it not so meaningful in the case.P.S. I'm not so familiar with TypeScript/React, just hoping this could make some progress to having Kroki support in Outline. Please feel free to give this a try.