Nigecat / obsidian-desmos

Embed graphs directly into your obsidian notes
GNU General Public License v3.0
125 stars 7 forks source link

Add option to always embed the svg for compatibility with web publishing #107

Closed gamberoillecito closed 4 months ago

gamberoillecito commented 10 months ago

Is your feature request related to a problem? Please describe. I'm using quartz to publish my notes and the desmos plots do not render and appear as a code block.

Describe the solution you'd like I'd like to have the option to directly embed the svg similarly to what can be done in excalidraw. I think it should be quite easy to implement since the svg is already generated if chaching in filesystem is on. To be able to edit the plot maybe it would be better to wrap the desmos code in a comment instead of a code block so that the code doesn't appear when exported.

Describe alternatives you've considered If the solution above is not feasible it would be helpful to have a way to directly obtain the svg path of the current desmos plot. For example if I'm in a code block I could press CTRL-SHIFT-O (or whatever) to copy the path of the correct svg so that it can be easily transcluded. A problem with this solution is that the code block would remain visible in the exported note. Again, maybe wrapping it with comments could solve the issue

A third solution would be to directly insert the iframe in the note similarly to what can be done by going to the desmos website and selecting "share" and then the third option "embed" to get the html code like the following one:

<iframe src="https://www.desmos.com/calculator/u3ngywi0hj?embed" width="500" height="500" style="border: 1px solid #ccc" frameborder=0></iframe>
Nigecat commented 4 months ago

I'm not sure if #119 actually fixes this, but it fixes a bunch of other things related to pdf exporting, so it might also fix this.