This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-16
Channels
- # announcements (9)
- # babashka (12)
- # beginners (60)
- # biff (2)
- # calva (4)
- # cider (4)
- # clj-commons (1)
- # clj-kondo (17)
- # clojure (2)
- # clojure-europe (17)
- # clojurescript (15)
- # emacs (18)
- # exercism (5)
- # fulcro (15)
- # holy-lambda (13)
- # joyride (1)
- # lambdaisland (2)
- # malli (1)
- # nbb (3)
- # off-topic (23)
- # polylith (6)
- # portal (59)
- # releases (1)
- # squint (1)
- # tools-deps (4)
Hi 🙂
Org-mode help wanted.
TL;DR:
I have an image on a an url like this:
- no jpg extension.
Is it possible to hotlink to this image from an org-mode document?
When I try [[
, I get an a href
, but I want an img src
in my HTML.
Any ideas? Are there org-native solutions to this that I'm not aware of?
More details in thread.
Thanks!
for reference, Here's the live page: https://play.teod.eu/kosekoding/ Here's my current full org source: https://github.com/teodorlu/play.teod.eu/blob/master/kosekoding/index.org And the text is all in Norwegian, sorry for that. Here's a https://play-teod-eu.translate.goog/kosekoding/?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp. But the idiomatic Norwegian ("kos") carries over very poorly. (https://www.visitnorway.com/typically-norwegian/kos-means-having-a-good-time/)
Full set of details: Normally, I just link to images like this:
[[./cat.jpg]]
But I want to hotlink to this image:
(rich explaining simple vs easy, first attached image)
But when I do this:
[[
Org-mode naturally makes a link for me, and my resulting HTML has an <a href=".." ...
, which is not what I wanted (second attached image).
I'm aware that I can hand code the HTML like this:
#+BEGIN_EXPORT html
<img src=""></img>
#+END_EXPORT
but I'd like to avoid that. It's tedious to write, and doesn't work when I export to other formats.one way to achieve this would be to write elisp that does exactly what your tedious, hand-coded HTML solution does...
you can even do this with a saved macro (in org-mode) http://xahlee.info/emacs/emacs/emacs_macro_example.html#:~:text=Save%20Keyboard%20Macro,x%20insert%2Dkbd%2Dmacro%20.
this is probably the easiest way
writing an interactive elisp function would be more readable than a saved macro
but if you just want a solution in minimal time, saving a macro is likely the most efficient way to automate some repetitive action that you do yourself (once you get used to it)
I will add that I am an org-mode
noob, and this recommendation isn't specialized to org-mode
... I suspect it will work fine, but I'm not certain
Huh, good point. I could just write myself a function. I'd still have to track the full export block in git, though.
Yeah, if you don't want to track the full export block in git, you'll need to change (or, fix?) the code in org