yuzutech / kroki

Creates diagrams from textual descriptions!
https://kroki.io
MIT License
2.87k stars 211 forks source link

Feature request : Please support public URI as diagram_source value #867

Open jvmlet opened 3 years ago

jvmlet commented 3 years ago

Would be great to be able to render diagram with this api:

GET /type/format/proxy?diagram_source=https://raw.github.com/myTextDiagram

This will enable users to include kroki generated diagram in Github's readme adoc/md files. Planutml server supports this with /plantuml/proxy?src=PUBLIC_URL parameter (described here under GitHub integration section )

Proxy mode is also described here

ggrossetie commented 3 years ago

This is somehow related to: https://github.com/yuzutech/kroki/issues/3 As mentioned in this issue:

The public instance of Kroki does not do any remote call for performance/security reasons so this approach won't work. I purposely want to keep the API as simple as possible. It takes a text diagram as input and returns an image.

I guess anyone could work on a proxy to fetch text diagrams from remote URLs and use Kroki as a backend to convert them to images. It could even be an additional services but I don't want to include it in core (at least for now).

marvst commented 3 years ago

Hey guys!

I'm not sure if it would fit for the suggestions you gave regarding adding a feature to generate the diagram's directly from its source, but I had a similar need for dealing with my own diagrams and I created a tool to help me with that. It's been of a great help so far so I hope it will help someone as well.

It uses Kroki to generate the diagram, but it keeps the source and you can embed to Notion, for example. Check it here https://diagramit.herokuapp.com/.

Thanks!

ggrossetie commented 3 years ago

Hey @marcosvst, thanks for sharing.

I'm not sure if it would fit for the suggestions you gave regarding adding a feature to generate the diagram's directly from its source, but I had a similar need for dealing with my own diagrams and I created a tool to help me with that. It's been of a great help so far so I hope it will help someone as well.

This is exactly what I had in mind 👍🏻

It uses Kroki to generate the diagram, but it keeps the source and you can embed to Notion, for example. Check it here diagramit.herokuapp.com.

I would gladly merge a pull request that describes this tool and how to use it in the documentation: https://docs.kroki.io/

What do you think?

marvst commented 3 years ago

Hey @Mogztter I liked the idea and thanks for being so receptive!

I created the pull request as you suggested here #898. Please let me know if something is off or out of the standards.

Thanks!