[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: stability of toc links
From: |
Timothy |
Subject: |
Re: stability of toc links |
Date: |
Sat, 01 May 2021 21:47:19 +0800 |
User-agent: |
mu4e 1.4.15; emacs 28.0.50 |
Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
> I don't think such a system would preserve properties offered by
> `org-export-get-reference', for example in non-latin languages. Also,
> header content is not stable enough: when you're linking to the custom
> ID, you may be able to change the title and yet preserve the link.
>
> However, your proposal may be an improvement over
> `org-export-get-reference' in the context of "ox-html.el", that I don't
> know. That's the second way I wrote about.
My proposal basically replaces the random hex generating function in
`org-export-get-reference' with a call to a function
`org-reference-contraction' which takes a header and outputs a string
like "some-header-string" and then has digits appended should it be
non-unique (i.e. "some-header-string-2", "some-header-string-3").
For certain recognised blocks (e.g. src and example blocks) it appends
",{block}--{n}", for example: "some-header-string,code--1".
I consider this to be quite a nice improvement.
--
Timothy