On 2023-06-20, at 08:07, Jens Lechtenboerger <lech...@wi.uni-muenster.de> wrote:

> On 2023-06-20, Marcin Borkowski wrote:
>
>> Dear Orgers,
>>
>> as I mentioned some time ago, I'm writing a custom exporter (actually,
>> a very thin wrapper around the HTML exporter).  I'd like `org-html-link'
>> to add some class to the links it generates.  Is that possible?
>
> Dear Marcin,
>
> yes, that’s possible, ":attr_html" is read in `org-html-link'.  You
> have to set that in your code, see [1] for an example for classes in
> my reveal.js backend.
>
> Briefly, with `elem' being the link, I use this:
> `(org-element-put-property elem :attr_html (list newattrs))'
>
> Best wishes
> Jens
>
> [1] https://gitlab.com/oer/org-re-reveal/-/blob/master/org-re-reveal.el#L2167

Great, it worked!  Though not at first – I had to experiment a bit to
find the right invocation:

(org-element-put-property link :attr_html (list ":class" "external"))

which was not obvious for me.

Thanks,

-- 
Marcin Borkowski
http://mbork.pl

Reply via email to