gitea
gitea copied to clipboard
Gitea: integration with Draw.io
Feature Description
Hi there!
I have an idea for integrating Gitea services and Draw.io. In my opinion, this can be a pretty useful thing!
"The user attaches the .drawio file to the messages in the issues. When clicking on the attached file, the user is redirected to the draw.io, at the same time, the contents of the file [XML in base64 or the like] are sent to the payload of the POST request. Draw.io receiving the file content and expands it into a schema. Apparently, the issue is complex and requires collaboration with the guys from Gitea. Let's try?" (с)
https://github.com/jgraph/drawio/issues/4128
Screenshots
No response
Ideally we would render .drawio files ourselves, but as far as I can tell, the drawio renderer is not available as standalone JS.
It is possible to self-host draw.io though, so if a integration is done, it should have configurable target URL. Iframing is certainly an option.
I wonder if this could be achieved with an external renderer via the config so nothing new needs to be added to Gitea
I wonder if this could be achieved with an external renderer via the config so nothing new needs to be added to Gitea
I don't think it's possible to be as an external renderer. Because it needs to read/save the files. It should be more like the markdown editor of course for .drawio files but .md files.
According to the statement on their README.
draw.io is not suitable as a framework for building other products from. For this try either Tldraw or Excalidraw.
Tldraw is non-commercial license. Looks like https://github.com/excalidraw/excalidraw is the only possible solution.
As I understand it, the only official draw.io interface is the full-blown editor UI. What we need would be a viewer-only UI. Maybe there are third-party made renderes available somewhere.
Seems confluence has done some integration with a viewer.min.js file from the draw.io repo, so it may be possible:
https://www.drawio.com/doc/faq/configure-javascript-viewer-drawio-confluence-server
gitlab supports viewing, editing draw.io files. seems to work offline from draw.io some links:
- some code in master: https://gitlab.com/gitlab-org/gitlab/-/tree/master/app/assets/javascripts/drawio?ref_type=heads
- and merge request that looks like mvp: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/86206/diffs#7981eac67e1980a41d95e5bfc2ccea7350ce53ae
i think editing is a very nice feature.
Seems they are embedding a iframe from https://embed.diagrams.net, not an ideal solution but could at least work with self-hosted renderer if that URL is made configurable.
Why not just use drawio JS as lib?
Why not just use drawio JS as lib?
There is no lib as far as I know, it's only available integrated with their backend.