sblakey / obsidian-quip

Obsidian plugin to publish notes to Quip.com
MIT License
23 stars 3 forks source link

Feature request: convert mermaid diagrams to png/svg #31

Open nineangel opened 1 month ago

nineangel commented 1 month ago

Obsidian supports Mermaid diagrams https://help.obsidian.md/Editing+and+formatting/Advanced+formatting+syntax#Diagram But they exported to Quip as a string. It appears mermaid api supports conversion to PNG/SVG. Is it possible to add this functionality to the plugin, so diagrams added to quip as images? https://github.com/mermaid-js/mermaid-cli

sblakey commented 4 weeks ago

I'm motivated to do this, since I use Mermaid in many of my diagrams.

The "trick" will be finding a way to access the Mermaid instance bundled with Obsidian in a reliable way. Otherwise, I may need to bundle the mermaid library as a dependency.

After that, it's just a matter of rendering to SVG, and testing if Quip will import SVG inlined to HTML, or attaching it to the document as an external blob.

nineangel commented 4 weeks ago

...and I wonder if using "refresh document from Quip" will re-write code section with generated image...