Nigecat / obsidian-desmos

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

Admonition Integration #52

Closed ndharari closed 2 years ago

ndharari commented 2 years ago

Hi there! Your plugin is amazing man. One small thing, it would be great if we could integrate it with the Admonition Plugin. Right now, when I try to use the codeblock syntax it breaks, as the desmos graph cannot be nested in an admonition.

Maybe a diferent syntax only for this case, using ~~~ instead of ````?

Nigecat commented 2 years ago

Could you include an example of the content that doesn't work? When I try it locally both the integrated Obsidian Callouts and Admonition blocks work fine - image (Using the syntax outlined here for the Admonition plugin)

ndharari commented 2 years ago

Hi, sorry for the delay. After a little testing, found that the problem arrises only in live preview

```ad-exer
title: Ejercicio

~~~desmos-graph
x+y=4
~~~

this is ment to be inside the admonition
where the latter text does not appear to be in the admonition. In reading mode though its ok.
The following code works fine:

[!NOTE] Note this is a straigh line

left=-10; right=10;
top=10; bottom=-10;
height=300; width=300;
---
y=\sin(x)|y>0|green|dashed
y=2|x>0|red|dotted
2=\frac{x}{y}
(0,0)

this is meent to be inside the admonition

Nigecat commented 2 years ago

Weird, that first example works fine for me in live preview mode - image image

I'll have a further look into the live preview mode since I usually don't use it so there may be bugs in the way it handles input.

ndharari commented 2 years ago

image

I attach the output so you can see the problem i was refering then

Nigecat commented 2 years ago

Hi, sorry for the delay. After a little testing, found that the problem arrises only in live preview

```ad-exer
title: Ejercicio

~~~desmos-graph
x+y=4
~~~

this is ment to be inside the admonition

Is ad-exer a custom Admonition block? If I copy this content nothing happens since Obsidian does not seem to know about this codeblock type even with the Admonition plugin installed (unless you're using a different plugin than this one).

ndharari commented 2 years ago

Yes, really sorry, it is. Same behaviour while using the note adm though.

Nigecat commented 2 years ago

I'm going to tag this as needs-more-info for now, as I still can't reproduce it... If you are still having the problem could you potentially create a vault with just the configuration to trigger this issue and upload it?

ndharari commented 2 years ago

So I created a new vault and the problem is not there, so its surely a problem with another plugin I have installed. If you want to close the issue now, given thats a minor bug on my setup its ok thanks for the support!