emacs-orgmode
[Top][All Lists]
Advanced

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

Re: How to tell `org-html-link' to create a link with some HTML class?


From: Marcin Borkowski
Subject: Re: How to tell `org-html-link' to create a link with some HTML class?
Date: Tue, 20 Jun 2023 17:20:23 +0200
User-agent: mu4e 1.1.0; emacs 30.0.50

On 2023-06-20, at 08:07, Jens Lechtenboerger <lechten@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

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