daledesilva / obsidian_ink

Other
265 stars 6 forks source link

Use Ink with pandoc | embed drawing/writing or export as image? #51

Open tobias0409 opened 1 month ago

tobias0409 commented 1 month ago

Hey, I use pandoc to export the markdown file to a nice looking PDF.

Unfortunately,

  1. It is not possible to embed the "Drawings" or "Writings" and then export those -> will just shown as codeblocks
  2. I cant find a way to export the drawing as svg/png and embed those. As far as I know in a previous version there was always a .png file

Is there a way to achive the result I wish?

Edit: For example Excalidraw for obsidian has a auto-export feature, which automatically creates an svg/png export of the file and keeps it updated, when a change is made.

grafik

daledesilva commented 1 month ago

Thanks for posting your issue. In a previous version, a PNG was created, however, I disabled that when I switched over to creating SVGs.

I'll be fixing this issue properly during release 0.4, (probably around august), which will mean you won't have to do anything, as the files will already be embedded and printable in your note.

Until then though, there are a couple of things you/I could do.

You can use brat to install 0.1.19 This will lack several new features and have some bugs, but if it works for you it's functionally similar and creates pngs on Windows & OsX.

I'll also look into turning that old png creation ability on again as an option. Hopefully it's doable quickly.

tobias0409 commented 1 month ago

Thanks for your fast answer! :)

You're right, if I export using the standard Obsidian "Export to PDF..." option, everything works perfectly. I'm looking forward to the export feature!

Here some additions to it, but not that important:

However, if I use Pandoc as my Markdown to PDF converter, it doesn't work properly. The issue is that Pandoc converts the Markdown to LaTeX and then LaTeX to PDF (as far as I know, also new to Pandoc), which causes Pandoc to transform code blocks into code listings. Here's an example:

grafik

Also, I would like to upload notes with handwritten parts to my web server, which only supports Markdown files. Since the server doesn't support the Obsidian plugin, it can't display the handwritten parts correctly.

Regarding the code block embed issue: I noticed you want to avoid this so the embedded drawings/writings still work. Before using Obsidian, I used Joplin, which employs js-draw. The export to Pandoc/web server worked nicely with Joplin because it uses real .svg files. The embedded .svg has a button to click for editing. Here’s a short demo: it's essentially an embedded .svg that you can edit by clicking a button. Maybe this approach can help.

https://github.com/daledesilva/obsidian_ink/assets/57797397/5353c6c4-c989-4b9e-9b79-daa493f35eed

daledesilva commented 1 month ago

Thanks for the video. And yep, that type of SVG embed is exactly how Ink will work in the future.