nobiot / org-transclusion

Emacs package to enable transclusion with Org Mode
https://nobiot.github.io/org-transclusion/
GNU General Public License v3.0
924 stars 47 forks source link

Allow automatically displaying inline images in transcluded content #256

Open ParetoOptimalDev opened 5 days ago

ParetoOptimalDev commented 5 days ago

Either using org-startup-with-inline-images or org-display-remote-inline-images or maybe providing a new one?

It looks like in issue #127 there were issues around the image display not being updated. My most common case is just viewing transcluded images however, so an option would be nice even if updating doesn't work perfectly.

nobiot commented 4 days ago

We have this abnormal hook. Do you think it can be used to call some built-in function to "refresh" the image link display?

(defcustom org-transclusion-after-add-functions nil
  "Functions to be called after a transclusion content has been added.
The hook runs after the content and the read-only text property
have been added so it is not supposed to manipulate the content
but to add further text properties.  For example, it is used by
the `org-transclusion-indent-mode' extension to support
`org-indent-mode'.  The functions are called with arguments beg
and end, pointing to the beginning and end of the transcluded
content."
  :type '(repeat function))
akashpal-21 commented 4 days ago

@nobiot

In upcoming 9.8 release - inline images have been reworked, we can possibly run the following in the abnormal hook

*** =C-c C-x C-v= command toggling inline image display has been reworked

Previously, =C-c C-x C-v= always toggled image display in the whole
buffer (or narrowed part of the buffer).  With prefix argument, it
also forced displaying image links with description.

Now, =C-c C-x C-v= is bound to a new command
~org-toggle-inline-images-command~, which uses different defaults:

1. By default, it toggles image at point or, if there is no image at
   point, images in current entry

2. When region is active, it is honored