emacs-orgmode
[Top][All Lists]
Advanced

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

Attributes on images (was:: Experimental public branch for inline specia


From: Rick Lupton
Subject: Attributes on images (was:: Experimental public branch for inline special blocks)
Date: Sun, 14 Apr 2024 16:59:09 +0100
User-agent: Cyrus-JMAP/3.11.0-alpha0-379-gabd37849b7-fm-20240408.001-gabd37849

Thanks for taking the time to comment thoroughly on this which seems generally 
like it would be a good improvement.

On Tue, 9 Apr 2024, at 9:52 AM, Ihor Radchenko wrote:
> 2. Allow attaching auxiliary attributes to the on object level, as an
>    equivalent of affiliated keywords on element level
>
>    - For example, we should allow assigning height per-link without the
>      awkward kludge we have with special handling of
>     
>      #+attr_html: :height 300
>      [[file:image.png]] has a height of 300, but what if we want a
>      different height in [[file:another-image.png]]?
>
>      We can thus do
>     
>      #+attr_html: :height 300
>      [[file:image.png]] has a height of 300, but what if we want a
>      different height in @@[:html-height 300]{[[file:another-image.png]]}?
>
>      Note how @@{...} markup assigns attributes to objects inside - the
>      attributes should be somehow inherited.

This way of assigning a height to the image seems odd to me.  Mostly, the 
attributes specified by the inline block apply to the block, not the contents, 
so wouldn't this case be potentially surprising?

Both of these examples mean different things in HTML, and it seems like you 
might want to create either -- how would you control which was produced using 
the "@@[:html-height 300]{[[file:another-image.png]]}" syntax?

<span><img height="300"></span>

<span style="height: 300"><img></span>

Instead, I wonder if the problem is that the way of inserting an image using a 
link itself.  If you need more control, could there be a special "img" inline 
special block which can handle additional attributes?

For example: 

@img[:height 300]{image.png} has a height of 300, and we can also have images 
with different heights and attributes like @img[:height 400 :alt "An 
image"]{another-image.png}.

Or, if using the original syntax, perhaps the attribute should be explicitly 
:img-attr or :img-height to resolve the ambiguity about which element is being 
targetted?

Rick



reply via email to

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