[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [FR] stable literal hrefs in HTML export of direct links and usage o
From: |
Ihor Radchenko |
Subject: |
Re: [FR] stable literal hrefs in HTML export of direct links and usage of link description instead of numbered links in case of shortend link syntax |
Date: |
Wed, 21 Aug 2024 16:51:21 +0000 |
Gregor Zattler <telegraph@gmx.net> writes:
> I write a piece documentation with a
> glossary in form of a description list
> and want to able to link to the
> descriptions. The thing is then
> exported to HTML.
>
> The only way to do that I found was with
> direct links, but this
>
> 1. does not allow for stable hrefs
>
> This
>
> An Emacs [[frame]] may be
> opened...
>
> - <<frame>> frame :: This is ancient
> terminology...
>
>
> This renders into (among other things):
>
> <div id="content" class="content">
> <p>
> An Emacs <a href="#orgc6125eb">1</a> may be
> opened…
> </p>
>
> <dl class="org-dl">
> <dt><a id="orgc6125eb"></a> frame</dt><dd>This is ancient
> terminology…</dd>
> </dl>
> </div>
You can customize `org-html-prefer-user-labels' to suppress
automatically generated IDs in your scenario.
> 1. that instead of a random id the link
> description is used as a href and
> therefore be stable between different
> exports, and
A more general question is whether we can default references to targets
in HTML export to use the target value.
I think that the answer for such a default is a no - IDs in HTML cannot
contain spaces, while Org mode targets can have spaces inside. Moreover,
in HTML4 spec, IDs are limited to latin characters, while Org mode
documents may not be latin-only.
Of course, we might also go into previously discussed idea to generate
valid IDs based on the text (we usually talk about it in the context of
headline IDs), but that will simply be a repetition of the previous
threads like
https://list.orgmode.org/orgmode/87wnrhl7z7.fsf@catern.com/
https://list.orgmode.org/orgmode/CAJcAo8tXVW39h18FUXLtwoDYNKQsFHqCp+YDiyWfLee29B1PRw@mail.gmail.com/
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>