npgrosser / logseq-diagrams-as-code

Logseq plugin that lets you create diagrams from textual representation (aka 'Diagrams as Code'). It supports a wide range of diagram types and languages, including Mermaid, Graphviz, PlantUML, and many more.
MIT License
173 stars 10 forks source link

Add an option to embed the generated figures #21

Open m-yaghini opened 1 year ago

m-yaghini commented 1 year ago

Hi. Thank you very much for this amazing plugin; especially the new tikz command works really well.

My only problem is that the figures generated are not embedded in the notes it seems. This means that once you publish the graph, the diagrams are not visible (presumably because plugins are not exported by LogSeq for publishing).

But if there was a way to embed the jpg/png/svg generated by kroki; then having the plugin in the published page (or the mobile version) would not be necessary to view the rendered figure; but just for changing it.

View of published graph page

image
npgrosser commented 1 year ago

Yes, you are right. The generated figure is not actually embedded into the notes, but rendered on-demand by the plugin. Adding an option to change that should definitely be possible. I will check that in the coming days.

scirenihil commented 1 year ago

Ability to embed the generated image would be greatly appreciated, as would the ability to regenerate if the associated code block changed - or at least a simple way to regenerate would be helpful.

This feature would also mean that images would be visible in a synced graph without the plugin installed.

In my case I generated diagrams on my Linux box using the plugin, but no images are displayed on android when synced via official logseq sync because (based on this issue / feature request) the plugin is not installed on my android device.

I could of course install the plugin everywhere, but it also means (I assume) that, without this feature, a permanent internet connection is required in order to view diagrams.

Thanks.

imJoshuaRice commented 6 months ago

I was about to open a Feature Request for some method of converting the embed into a static image - but it appears that this has been discussed in this thread.

scirenihil has perfectly explained the benefits of this - allowing images to be displayed on devices that do not have plugin support. This also means that public hosted instances (E.G running Logseq as an online documentation site) can benefit from the plugin.

Please consider this a bump for the topic, as I note it hasn't been Updated since last May.

Thanks