Extensions to Emacs org-mode to allow for associating any destination link with a local or remote image.
- org-img-link:
- The Problem – Image Links Don't Work As Described
- org-img-link allows for associating any link to an image.
- img-link Syntax
- Installation
- Usage
- Examples
- Origin And Status
- Known problems:
- Evolution Plans:
- Maintenance And Support
According To:
https://github.com/fniessen/refcard-org-mode/blob/master/README.org
Image links
To get image links, put a link to a file in the description.
Clicking on the image
[[http://orgmode.org/][file:images/org-mode-unicorn.png]]
leads to the Org mode home page.
But that syntax DOES NOT WORK for me – in org-version = 9.1.9 emacs 27.0.5 and emacs 26.2.
See ./inlineimages-example.org for examples of this.
The obvious natural way to do this with org links would have been:
[ [ link-destination ] [ link-description ] ]
And when link description had been a file specification or a url pointing to an image, the description would have become the image that you would click to get to link-destination.
As a work around, we are creating a new org-link-type called: "img-link". We would then use it like this:
[[img-link:img-path][link-destination]]
An example would then be:
[[img-link:file:/bisos//blee/env/images/signup.jpg][http://www.by-star.net]]
[[img-link:https://d1ra4hr810e003.cloudfront.net/media/27FB7F0C-9885-42A6-9E0C19C35242B5AC/0/D968A2D0-35B8-41C6-A94A0C5C5FCA0725/F0E9E3EC-8F99-4ED8-A40DADEAF7A011A5/dbe669e9-40be-51c9-a9a0-001b0e022be7/thul-IMG_2100.jpg][http://www.by-star.net]]
Notice that this link syntax is backwards with respect to the usual org-mode link syntax. This is due to implementation convenience.
You can initialize this package as:
(require 'org-img-link)
(xtn:org-add-link-type:img-link/activate)
You can then use it by:
(img-link-overlays) ;; to activate it and
(img-link-clear-overlays) ;; to go back to seeing it as text.
See <./org-img-link-example.md> for a set of examples.
Much of this code has been lifted from John Kitchn.
And at this time, it is just a stop gap measure. Such capability is so very essential that it should be incorporated into the org-mode proper. We hope that the equivalent code be incorporated in org-mode distribution.
[[link-destination][link-description-img]]
we have
[[img-link:link-description-img][link-destination]]
and not the link-destination.
(img-link-overlays) and (img-link-clear-overlays)
instead of the native
(org-toggle-inline-images) and (org-display-inline-images t)
in xtn:org-add-link-type:img-link :path/proc but img-link-overlays may be harder to fix. Need to see if xtn:org:link:description/get-at-point can be used there.
have (org-toggle-inline-images) do the job. Need to run this by the org-mode mailing list.
link syntax is incomplete. We should evolve org-mode to be on top of "Emacs Mark-Up Language" (EML) – a parallel to html5 – in which a link syntax would be at least as rich of html. html link syntax sees img as an integral part of the syntax. For example An image as a link is something like:
<a href="https://www.w3schools.com"> <img
border="0" alt="W3Schools" src="logo_w3s.gif" width="100"
height="100"> </a>
The link context that we are speaking of is that of the native org-link and is unrelated to org-exporting.
Mohsen BANAN – http://mohsen.1.banan.byname.net/contact