emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Link preview generation with new link preview property


From: Karthik Chikmagalur
Subject: Re: Link preview generation with new link preview property
Date: Thu, 12 Dec 2024 21:49:45 -0800

> The PR do port the package to this new handler property:
> https://github.com/gaoDean/org-remoteimg/pull/4
>
> However it left me with a few questions:
> - Who is supposed to take care of the scaling/width of the preview
>   image, the handler or the caller of the handler?

The handler is responsible for sizing the image.  The reason for this is
that the preview does not have to be an image -- it can be any kind of
overlay decoration.

If you decide to use an image file as the preview, you can call
`org-link-preview-file' inside your handler to handle the geometry for
you.  This includes the size and alignment specified by #+attr_*
keywords, `org-image-max-width' and `org-image-align'.

If you are using a preview image from image data, you'll have to copy
some of the code in `org-link-preview-file' to your handler if you want
to respect these user options.

> - When calling the link preview function for a description with prefix
>   argument 1 I noticed that it doesn't get the contents of the
>   description.
>   Why is that? In this instance the link looked like this:
>   
> [[https://stable.melpa.org/#/rpm-spec-mode][file:https://stable.melpa.org/packages/rpm-spec-mode-badge.svg]]

I don't follow.  What do you mean by "it doesn't get the contents"?  Did
the preview work as expected when you used a prefix arg of 1?

Karthik



reply via email to

[Prev in Thread] Current Thread [Next in Thread]