MSzturc / obsidian-advanced-slides

Create markdown-based reveal.js presentations in Obsidian
https://mszturc.github.io/obsidian-advanced-slides/
MIT License
948 stars 80 forks source link

Embeds are not being shown in presentations #239

Open jowitte opened 1 year ago

jowitte commented 1 year ago

Describe the bug Embeded files are shown as text instead of resolving and showing the file content

Samples to Reproduce Steps & Examples to reproduce the behavior:

  1. Create a slides file like this

` Slide 1


![[image.png]] `

  1. Show preview of the slide

Expected behavior

The presentation shows up showing the image instead of just the text "![[image.png]]"

marsvet commented 1 year ago

Same. Excalidraw is not being shown, too.

KoichaDev commented 11 months ago

I found the error by toggling the developer mode. It seems the code from this presentational plugin is not detecting the correct current file path if you created a markdown file on a nested folder. In order to make it work temporarily (not deal) is to put your markdown file into the root folder of your vault.

The only issue I am facing is that the presentational embedded doesn't contain a button to slide forward or backward. Since this presentational slider is not working properly, it's better just display your embedded image instead

Not sure if this is a bug, or not a feature that has been added yet.

santiyounger commented 11 months ago

I've been having this same issues. Thanks @KoichaDev for your insights.

I managed to solve my issue, so I'll share in more detail here:

I have my image in a folder in Obsidian called attachments this means that usually embedding the image like this would be enough: ![[attachments/image.png]]

In my case I have my slides note in an obsidian sub-folder. This is the reason why my images aren't displaying when I open "slides preview" to see the slides

Even if Obsidian can display these images: ![[attachments/image.png]] the slides plugin doesn't find the image because it can't find the image in the same folder where our presentation file is. Because my presentation note is in a subfolder. and my image is in another folder, in my case: attachments

Solutions and Workarounds

Option 1.

If possible like @KoichaDev said, we can just moved the slide presentation note to the root vault in obsidian. (removing it out of any subfolders.) that should fix any issues. However sometimes you want to keep things in subfolders for various reasons...

Option 2 - Workaround.

If you have your presentation note in 1 level of a subfolder we would have to add ../ like this: ![[../attachments/image.png]] to any embeds.

if your note is in 2 subfolders (2 levels deep of subfolders) then we'd manually have to send to add this ../../ like this: ![[../../attachments/image.png]]

That will work, however it's a manual workaround for now, hope there's an easy solution in the future to not have to worry about this

Thanks to the developer for such an incredible plugin, I use it every day. Hope this helps anyone else stuck in this issue

KoichaDev commented 11 months ago

I've been having this same issues. Thanks @KoichaDev for your insights.

I managed to solve my issue, so I'll share in more detail here:

I have my image in a folder in Obsidian called attachments this means that usually embedding the image like this would be enough: ![[attachments/image.png]]

In my case I have my slides note in an obsidian sub-folder. This is the reason why my images aren't displaying when I open "slides preview" to see the slides

Even if Obsidian can display these images: ![[attachments/image.png]] the slides plugin doesn't find the image because it can't find the image in the same folder where our presentation file is. Because my presentation note is in a subfolder. and my image is in another folder, in my case: attachments

Solutions and Workarounds

Option 1.

If possible like @KoichaDev said, we can just moved the slide presentation note to the root vault in obsidian. (removing it out of any subfolders.) that should fix any issues. However sometimes you want to keep things in subfolders for various reasons...

Option 2 - Workaround.

If you have your presentation note in 1 level of a subfolder we would have to add ../ like this: ![[../attachments/image.png]] to any embeds.

if your note is in 2 subfolders (2 levels deep of subfolders) then we'd manually have to send to add this ../../ like this: ![[../../attachments/image.png]]

That will work, however it's a manual workaround for now, hope there's an easy solution in the future to not have to worry about this

Thanks to the developer for such an incredible plugin, I use it every day. Hope this helps anyone else stuck in this issue

Hey there! It's great to hear that you found another workaround solution, and I'm happy you shared this information here.

sjgknight commented 1 week ago

In case anyone else is looking for a workaround. I played with

In preview, using markdown links, with .md extension, with/without headings, and with URL encoded relative paths, is the closest to working. It shows content on the slide, but it seems to not render the rest of the presentation. It doesn't export.

![](../../design-test/When%hello%20worlding.md)

Not sure if that's helpful to anyone but just in case!