emacs/var/elfeed/db/data/38/38240b8fb8123e8815b769a30882b8c00c2d67cb
2022-01-03 12:49:32 -06:00

3 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>Yuan Fu likes to take notes in which he can embed images. You can do that with Org, of course, but Fu doesnt like that Orgs solution boils down to a link to a file. That means you have to keep the file paths in sync. He wanted a solution that embedded the image in the file <i>and</i> made it easy to resize the image on the fly.</p>
<p>To a first approximation, <a href="https://casouri.github.io/note/2020/embed-images-in-text-files/index.html">his solution</a> is simple: Embed the image as a Base64 string at the bottom of the buffer and put an internal link to it at the point to where it is to appear. Of course, there are complications. First, theres handling the resizing. Thats not too hard but there are also display issues such as having reasonable scrolling. Fu has some animated screenshots that show this in action. It appears to work well.</p>
<p>The <a href="https://github.com/casouri/lunarymacs/blob/master/site-lisp/iimg.el">code</a> does not appear to be in Melpa and Fu doesnt say whether he plans to submit it but its a single file and should be easy to load and try out. If you have a need to permanently embed images in a file and dont want to have to worry about keeping file paths in sync, this is a good solution.</p>