obsidian-digital-garden icon indicating copy to clipboard operation
obsidian-digital-garden copied to clipboard

[Feature request] Directly support publish of .excalidraw.md files

Open dclausen01 opened this issue 2 years ago • 10 comments

Hi there, I have a use case in which it would be great, if Excalidraw-Files (in .md files, that means with front matter) could be directly rendered and published. Unfortunatly I don't have a good idea about how to do this, becausr I'm not too deep into the inner workings of the excalidraw plugin. It would be great if this would work:

  1. Add dg-publish: true to front matter of an .excalidraw.md file
  2. File is rendered (to png or svg) and ...
  3. ... published (as image version) automatically.

Right now I auto-export .png from Excalidraw, generate a new note, embed the .png and add dg-publish: true to that file. Thanks for your great plugin, BTW!

dclausen01 avatar Apr 14 '22 09:04 dclausen01

Hi! Currently the plugin supports embedding excalidrawings like so:

![[drawing.excalidraw]]

So you don't need to export it to a png. Simply add it to a note an publish it. Will that meet your needs?

oleeskild avatar Apr 14 '22 20:04 oleeskild

Hi, thanks for your fast reply! I guess this makes things easier for me, yes! In the long run I might need to find a way to automate the whole process - I use Excalidraw for teaching and upload the content to my digital garden for my students.

dclausen01 avatar Apr 14 '22 20:04 dclausen01

Awesome to hear it is being used for that.

I don't see why publising an exalidraw file as its own page should be a problem. It is just a markdown file after all. I'll look into adding it when I find the time. Thanks for the input!

oleeskild avatar Apr 14 '22 21:04 oleeskild

Thanks a lot, mate, I really appreciate it!

dclausen01 avatar Apr 14 '22 21:04 dclausen01

Hi! Support for publish excalidraw files directly has been added in the latest release, 2.9.1. Simply add dg-publish: true to the frontmatter of the file and it should work as if publishing a "normal" markdown file. Let me know if it's working for you.

oleeskild avatar Apr 17 '22 23:04 oleeskild

Hi Ole! I tested the new version right away - but I could not publish an excalidraw note - when I try single note publishing (via command), there is no response from the plugin and on "publish multiple notes" I get: "Unable to publish multiple notes. Something went wrong". When I use the ribbon icon it seems there is no function, too. I can't publish changed notes. Can I help to pinpoint the error?

dclausen01 avatar Apr 18 '22 08:04 dclausen01

Thats weird, perhaps there are some edgecase that I haven't thought of. Could you copy the entirety of the content of the excalidraw.md file that is not working and paste it here?

oleeskild avatar Apr 18 '22 10:04 oleeskild

Or maybe, as nothing is working, could it be that the github token has expired? 🤔

Could you open up the developer tools in obsidian by pressing CTRL+SHIFT+I (CMD+SHIFT+I on mac), then use the publish command and screenshot whatever appears in the developer console?

oleeskild avatar Apr 18 '22 12:04 oleeskild

Ahhh, my bad! I had LZ-compression on for Excalidraw. That was the problem. Now everything works! I now have kind of a "viewport" in which I can scroll over my drawings: image

Thanks so much!

dclausen01 avatar Apr 18 '22 13:04 dclausen01

I found one (really big) Excalidraw file which is not published correctly. I attached the file here (too big for pastebin...)

Obsidian-Setup für Unterricht.zip Obsidian-Setup für Unterricht

EDIT: But this one is not something I would use in my daily work. All of my "normal" Excalidraw files work great!

dclausen01 avatar Apr 18 '22 13:04 dclausen01