emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [FR] [Revived] Human readable / customizable link anchors during exp


From: Kévin Le Gouguec
Subject: Re: [FR] [Revived] Human readable / customizable link anchors during export
Date: Wed, 12 Oct 2022 19:38:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Ihor Radchenko <yantar92@gmail.com> writes:

> Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:
>
>>> 3. Instead of trying to find a silver bullet for human-readable anchor
>>>    generator, we allow users to customize it. The default will be
>>>    constant "org" yielding "org-Ajjq"-type anchors, just like we have
>>>    now. But we can also provide other generators, like the one Timothy
>>>    proposed, or better versions contributed in future if there is
>>>    demand.
>>
>> Personally, I'd be wholly satisfied with a customization option; the
>> grail for me would be [pandoc's algorithm], which doesn't look too hard
>> to reimplement in one's config.
>>
>> (Although the collision-handling logic could be tricky: since it
>> revolves around appending a counter to the ID, it needs to keep track of
>> how many times the same ID has been generated for the whole document.
>> If the generator API is just {heading ↦ ID}, i.e. there is no extra
>> "context" argument, one will need to do some bookkeeping "on the
>> side"…)
>
> The collision-handling should not concern the anchor generator code. If
> an anchor generator returns a duplicate ID, we can just append some
> symbols to make it unique. All the bookkeeping has to be made in
> centralized way on ox.el side.

Well, it depends on what "some symbols" are.  Pandoc's counter-based
suffixes, for example, are reproducible & stable for a given document
outline.

That's why I'd personally like to have those.  Other suffix-generation
schemes (e.g.  hashing the section content) might produce something
reproducible as well, but not necessarily so stable wrt the outline
(e.g. hashing the section content will produce different results
everytime I add or remove a comma).



reply via email to

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