Closed AblatedSprocket closed 2 years ago
hi @AblatedSprocket thanks for taking the time to open this issue with your question.
Do you refer to inserting an Org-Mode link to an image file and get that link to be translated to an <img>
tag? If so, you currently have to link it directly to the file with a regular org-mode link
[[/path/the/image/file.png]]
If you're looking into using weblorg's routing system, unfortunately, url_for
currently only generates a
tags. e.g.:
[[url_for:static,file=image.png][an image]]
I think it'd be great to find a way to tell url_for
to generate an img
tag instead of a regular link. Let me know if you have any suggestions. I'll see if I can come up with something too in the meantime 😄
There's another issue open for this, but I think my ideal use case would be using plain old org syntaxes and weblorg would override the exporter. That sounds hard though.
Using url_for would work ok for me as well and sounds easier, I'll look and see if I can think of something.
What if we just add another definition in org-link-set-parameters:
(org-link-set-parameters
"img"
:export (lambda(path desc _backend)
(format "<img href=\"%s\" />" (weblorg--url-for path site)))
Hi @AblatedSprocket 👋🏾 this looks pretty good to me. What do you think about calling it url_for_img
?
you can register it in weblorg--route-install-template-filters
🙇🏾 do you think you'd be interested in trying to put another lil PR for this? 😄
You know, I just might
Just merged #53, thank you @AblatedSprocket for another contribution to weblorg 😄 thank you for taking the time 🙇🏾
Thanks for creating such a great library!
added docs for this the commit https://github.com/emacs-love/weblorg/commit/7ccfc443d1d4ded4cde0b6b6e9ebd184601a94d6
Is there support for parsing on Org link to an image file when exporting? For example, parsing the link as an
tag (or something) in the HTML output?