From: Marcin Borkowski <mbork@mbork.pl>
To: Jens Lechtenboerger <lechten@wi.uni-muenster.de>
Cc: Org-Mode mailing list <emacs-orgmode@gnu.org>
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 [thread overview]
Message-ID: <87a5wudutk.fsf@mbork.pl> (raw)
In-Reply-To: <87sfamll8s.fsf@wi.uni-muenster.de>
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
next prev parent reply other threads:[~2023-06-20 15:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-20 4:42 How to tell `org-html-link' to create a link with some HTML class? Marcin Borkowski
2023-06-20 6:07 ` Jens Lechtenboerger
2023-06-20 15:20 ` Marcin Borkowski [this message]
2023-06-20 16:30 ` Max Nikulin
2023-06-21 19:17 ` Marcin Borkowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a5wudutk.fsf@mbork.pl \
--to=mbork@mbork.pl \
--cc=emacs-orgmode@gnu.org \
--cc=lechten@wi.uni-muenster.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).