Skip to content
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

[FEATURE] DrawIO integration #3010

Open
patvdv opened this issue Apr 15, 2024 · 7 comments
Open

[FEATURE] DrawIO integration #3010

patvdv opened this issue Apr 15, 2024 · 7 comments

Comments

@patvdv
Copy link
Sponsor

patvdv commented Apr 15, 2024

Is your feature request related to a problem? Please describe.

Not related to a problem and I know this a big ask. But here it is anyway.

Describe the solution you'd like

I would love to see an integration with DrawIO (diagrams.net) via a plugin(?), allowing diagrams to be natively displayed - and if possible - edited in QON. My reference is the availability and use of the DrawIO plugin in the Atlassian Jira & Confluence suites, e.g.: https://www.drawio.com/doc/drawio-confluence-cloud.

Here is how it could potentially work from a conceptual point of view:

  • Storage: add the DrawIO object as an attachment to a note.
  • Rendering: in the QON Preview mode, the drawing is rendered as a native DrawIO diagram. Or alternatively, as an on-the-fly generated image of the drawing (png, svg, ...)
  • Editing:
    • Allow the DrawIO object to be edited outside QON, either using the native desktop client or via diagrams.net.
    • -OR- allow the DrawIO object edited inside QON using the plugin. This would be by far the hardest and most complicated part. I don't even know if there is public code available for this but there seem to be quite a lot of exiting 3rd party integrations already: https://www.drawio.com/integrations.

Describe alternatives you've considered

None, IMHO DrawIO is the Visio of the FOSS world. For many it is a cornerstone in technical documentation.

Additional context

None, but in my experience a visual often speaks louder than a 1000 words.

@pbek
Copy link
Owner

pbek commented Apr 15, 2024

Since the preview isn't a fully fledged browser, that integration would be clunky at best, if ever attempted. 😬
And it would be far away from the Markdown spec...

But lots could already be done with the scripting engine, e.g. like:

... or similar

@pbek
Copy link
Owner

pbek commented Apr 15, 2024

OOT: Oh, thank you for the sponsorship. 😁

@patvdv patvdv changed the title [FEATURE] DrawIO integratin [FEATURE] DrawIO integration Apr 15, 2024
@patvdv
Copy link
Sponsor Author

patvdv commented Apr 16, 2024

Since the preview isn't a fully fledged browser, that integration would be clunky at best, if ever attempted. 😬 And it would be far away from the Markdown spec...

But lots could already be done with the scripting engine, e.g. like:

* https://github.com/qownnotes/scripts/tree/master/latex-math

* https://github.com/qownnotes/scripts/tree/master/paste-latex-image

* https://github.com/qownnotes/scripts/tree/master/mermaid

... or similar

On the markdown spec: I would advocate to extend it with a special notation, something like:

![plugin:drawio:param1:param2]
etc

I know that it would break compliancy with markdown standards but it wouldn't break functionality as the markdown would simply not resolve in other editors. It would also be a way to allow for future extensions still. Such an QON-only feature would also be an additional reason to use QON, and not another tool.

@pbek
Copy link
Owner

pbek commented Apr 16, 2024

On the markdown spec: I would advocate to extend it with a special notation, something like

Can you please elaborate what "extending the spec" means for you?

There is no architecture for such plugins in QOwnNotes, no coloring either, and neither the highlighter nor md4c (for the preview) would support them. And the preview itself is also no browser.

But with https://www.qownnotes.org/scripting/hooks.html#prenotetomarkdownhtmlhook and https://www.qownnotes.org/scripting/hooks.html#notetomarkdownhtmlhook you can already parse that in a script and interpret it in whatever way...

@pbek
Copy link
Owner

pbek commented Apr 17, 2024

And I almost forgot, there is https://www.qownnotes.org/scripting/methods-and-objects.html#adding-a-highlighting-rule-for-the-editor if you want to add a rule to the highlighter of the editor.

@77nnit
Copy link

77nnit commented May 2, 2024

But with https://www.qownnotes.org/scripting/hooks.html#prenotetomarkdownhtmlhook and https://www.qownnotes.org/scripting/hooks.html#notetomarkdownhtmlhook you can already parse that in a script and interpret it in whatever way...

OT: is there any way to leverage the HTML DOM API inside the QtQML scripts? I understand that there's no browser to support the API, but maybe some Qt library? I see that in the scripting examples HTML is parsed using regexes, and that is not really practical. It's a shame that you can't access the traversing methods and properties when you have an HTML at hand!

@pbek
Copy link
Owner

pbek commented May 2, 2024

OT: is there any way to leverage the HTML DOM API inside the QtQML scripts?

You would need a real browser to interpret that, and you can't just pull in one that works on every platform in a script and show it somehow... But you can use JS libraries in a QML, I added a way to include JS files, and people did in the script repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants