[FR] [Revived] Human readable / customizable link anchors during export (was: stability of toc links)

2022-10-11 Thread Ihor Radchenko
Timothy writes: >> Link stability is still an issue, even if the proposal gives a false >> sense of security in that area. I don't think we can solve it without >> creating a cache for export, where you store all previous references for >> a given file. Even this is not sufficient, because you ca

Re: stability of toc links

2022-10-11 Thread Ihor Radchenko
Samuel Wales writes: > [as for drawers, as an aside: to my sensibilities, too many make the > document author wonder if they contain anything significant, require > opening them to make sure they are ok, and take up space in the emacs > window which in my case is highly limited. also, they possi

Re: stability of toc links

2022-10-10 Thread Robert Weiner
I missed the beginning of this; what exactly are you looking for? If you don’t want ids attached to the headlines that go into the toc, are you asking for code that automatically updates the toc on any change to individual headlines inthe document body? It would probably be easier to just have

Re: stability of toc links

2022-10-09 Thread Samuel Wales
[i should clarify the clarification as i do not want it to seem like saying i already covered that was the only point for no reason. what i meant is to provide context for those who are stumbling upon this long thread. it seems an active topic and a lot of custom id solutins were presented and wh

Re: stability of toc links

2022-10-09 Thread Samuel Wales
On 12/8/20, Tom Gillespie wrote: > It sounds like you are looking for the CUSTOM_ID property. just for clarity, i addressed this in my original post when i said "short of adding custom id or id to everything".

Re: stability of toc links

2021-05-02 Thread Timothy
Nicolas Goaziou writes: > Please note that those short answers did not help me much. So I did my > homework and looked at your code. I didn't test it thoroughly, so I may > be missing something. It's a pity to hear that I wasn't able to suitably clarify things in my reply. Thank you for being

Re: stability of toc links

2021-05-02 Thread Nicolas Goaziou
Hello, Timothy writes: > Nicolas Goaziou writes: > >> I pointed out some concerns I have about the robustness of this system >> already. I don't think you answered to any of them. I fear we may be >> communicating past each other in this thread. > > Sorry about that. I'll try to address the bit

Re: stability of toc links

2021-05-01 Thread Timothy
Nicolas Goaziou writes: > I pointed out some concerns I have about the robustness of this system > already. I don't think you answered to any of them. I fear we may be > communicating past each other in this thread. Sorry about that. I'll try to address the bits I've missed in these last few e

Re: stability of toc links

2021-05-01 Thread Nicolas Goaziou
Timothy writes: > Nicolas Goaziou 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

Re: stability of toc links

2021-05-01 Thread Timothy
Nicolas Goaziou 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

Re: stability of toc links

2021-05-01 Thread Nicolas Goaziou
Hello, Timothy writes: > Nicolas Goaziou writes: > >> With the above in mind, I think there are two ways to "improve TOC links >> stability": >> >> 1. Improve the system behind `org-export-get-reference', e.g., so it >>behaves better during plain export. But please keep in mind that >>c

Re: stability of toc links

2021-05-01 Thread Timothy
Nicolas Goaziou writes: > With the above in mind, I think there are two ways to "improve TOC links > stability": > > 1. Improve the system behind `org-export-get-reference', e.g., so it >behaves better during plain export. But please keep in mind that >current major properties must be p

Re: stability of toc links

2021-05-01 Thread Nicolas Goaziou
istency > across published versions. This is currently true. > If stability of TOC links across versions is required, using publish is > the preferred mechanism. If we would want to make it easier for the user > to create published pages with consistent internal TOC links, we would

Re: stability of toc links

2021-04-30 Thread Greg Minshall
in this thread... > > The publish feature only means exporting several files at once. > You can publish a single file, too. It makes sense when a file is always > exported to the same location, possibly with the same configuration. my model is that exporting is to publishing as, well, as org mo

Re: stability of toc links

2021-04-30 Thread Tim Cross
is export facility is also used for things like HTML fragments and because internal link stability is only required in a sub-set of use cases. The org publish facility already includes the necessary internal facilities to support internal link consistency across published versions. You can use publish

Re: stability of toc links

2021-04-30 Thread Maxim Nikulin
On 30/04/2021 13:24, Timothy wrote: Dominique Dumont writes: For what it's worth, DNS servers faces a similar problem where host names can contain any unicode character, but DNS servers support only ascii char. In DNS cases, this is worked around using punycode. (1) Using the example above, a

Re: stability of toc links

2021-04-30 Thread Nicolas Goaziou
Hello, Samuel Loury writes: > The publish feature only means exporting several files at once. You can publish a single file, too. It makes sense when a file is always exported to the same location, possibly with the same configuration. > IIUC, what was written was that when using the publish

Re: stability of toc links

2021-04-30 Thread Samuel Loury
Hi. I understood differently. Tim Cross writes: [...] > A question to help me understand this issue. > > If I understand correctly, exporting to HTML does not guarantee > stability of TOC links. If you export as HTML, send someone a link from > the toc and then re-export th

Re: stability of toc links

2021-04-29 Thread Timothy
Dominique Dumont writes: > For what it's worth, DNS servers faces a similar problem where host names can > contain any unicode character, but DNS servers support only ascii char. In DNS > cases, this is worked around using punycode. (1) > > Using the example above, a host named "こんにちは.example"

Re: stability of toc links

2021-04-29 Thread Tim Cross
aid he originally did not get much > interest. then there was interest on this thread. then nothing. > A question to help me understand this issue. If I understand correctly, exporting to HTML does not guarantee stability of TOC links. If you export as HTML, send someone a link from

Re: stability of toc links

2021-04-29 Thread TRS-80
On 2021-04-29 18:18, Samuel Wales wrote: On 4/29/21, TRS-80 wrote: My "quick and dirty" solution was to make a function to map over each heading and assign a custom ID based on the text of the heading. It only assigned one if one did not exist already (so in case you had done any manual adju

Re: stability of toc links

2021-04-29 Thread Samuel Wales
hi trs, thank you. i can imagine that could be useful for a lot of users, but for me, as i said in my op, "short of adding custom id or id to everything" --- i didn't want to add custom id. i will try to clarify why in case it is useful. in addition to performance, and clutter, there is a seman

Re: stability of toc links

2021-04-29 Thread TRS-80
On 2021-04-21 19:30, Samuel Wales wrote: as it has been a long time my original post is Message ID and the content is === when you link to a section using toc, you get a link like https://thekafkapandemic.blogspot.com/2020/02/crimes-against-humanity_3.html#org080f0ab will these links bre

Re: stability of toc links

2021-04-25 Thread Dominique Dumont
On Wednesday, 21 April 2021 18:24:27 CEST Nicolas Goaziou wrote: > In particular, I'm not sure to understand how one system can generate an > ID based on the heading content and still limit itself to alphanumeric > characters. For example, what ID are generated with the following > document? > > -

Re: stability of toc links

2021-04-23 Thread Timothy
Maxim Nikulin writes: > python3 -c 'import unidecode; print(unidecode.unidecode("こんにちは"))' > konnichiha > > python3 -c 'import unidecode; print(unidecode.unidecode("コンニチハ"))' > konnitiha It looks like this isn't built into Emacs, and a package would be needed: https://github.com/sindikat/unide

Re: stability of toc links

2021-04-23 Thread Samuel Wales
i should point out that idk what is allowed in links. if uppercase is not, then script need not be indicated or can just use a prefix. On 4/23/21, Samuel Wales wrote: > python is merely using a different romanization for the second script. > it might consider uppercase [same romanization] for th

Re: stability of toc links

2021-04-23 Thread Samuel Wales
[and also that i was merely looking at the examples and maxim's analysis which i agree with, not tec's or others' code.] On 4/23/21, Samuel Wales wrote: > i should point out that idk what is allowed in links. if uppercase is > not, then script need not be indicated or can just use a prefix. > >

Re: stability of toc links

2021-04-23 Thread Samuel Wales
python is merely using a different romanization for the second script. it might consider uppercase [same romanization] for the latter script instead. other than that, the overall approach [using export] is good imo. idk what transliterators exist in emacs. i think the principle of least surprise

Re: stability of toc links

2021-04-23 Thread Maxim Nikulin
On 21/04/2021 23:24, Nicolas Goaziou wrote: In particular, I'm not sure to understand how one system can generate an ID based on the heading content and still limit itself to alphanumeric characters. For example, what ID are generated with the following document? My impression is that such con

Re: stability of toc links

2021-04-21 Thread Samuel Wales
as it has been a long time my original post is Message ID and the content is === when you link to a section using toc, you get a link like https://thekafkapandemic.blogspot.com/2020/02/crimes-against-humanity_3.html#org080f0ab will these links break if somebody copies them and pastes

Re: stability of toc links

2021-04-21 Thread Samuel Wales
more below. [note the two samuels.] On 4/21/21, Samuel Loury wrote: > advance what heading he will share, so he would have to add CUSTOM_ID > everywhere, just in case. This sounds like a lot of unnecessary work. > > The solution of tec¹ appears to be a new generation of the html ids based > on t

Re: stability of toc links

2021-04-21 Thread Nicolas Goaziou
Hello, > The solution of tec¹ appears to be a new generation of the html ids based > on the heading content rather than apparently randomly generated, making > the generated link become the same across new generations. AFAICT, the link you send only contains code, not explanations nor design. In

Re: stability of toc links

2021-04-21 Thread Samuel Loury
Nicolas Goaziou writes: [...] > Samuel Wales writes: > >> i was referring to: >> >> Message ID <87v9dbelky@gmail.com> >> >> in this thread. >> >> [and other posts in this thread related to it.] > > Unfortunately, I won't have time to look at the whole thread anytime > soon. However, feel

Re: stability of toc links

2021-04-21 Thread Nicolas Goaziou
Hello, Samuel Wales writes: > i was referring to: > > Message ID <87v9dbelky@gmail.com> > > in this thread. > > [and other posts in this thread related to it.] Unfortunately, I won't have time to look at the whole thread anytime soon. However, feel free to explain how "tec's fix" works,

Re: stability of toc links

2021-04-20 Thread Samuel Wales
hi, > I don't know what "tec's fix" is, i was referring to: Message ID<87v9dbelky@gmail.com> in this thread. [and other posts in this thread related to it.] the problem as i see it is link stability in generated output. On 4/20/21, Nicolas Goaziou wrote: > Hello, > > Samuel Wales

Re: stability of toc links

2021-04-20 Thread Nicolas Goaziou
Hello, Samuel Wales writes: > thank you. i use export. e.g. export a subtree to html and paste > into blogger. i don't use publish. > > for me [and some others on this thread iirc] tec's fix looks good, > fwiw. it would not proliferate custom id or id, and would fix both. Note that I merely

Re: stability of toc links

2021-04-19 Thread Samuel Wales
thank you. i use export. e.g. export a subtree to html and paste into blogger. i don't use publish. for me [and some others on this thread iirc] tec's fix looks good, fwiw. it would not proliferate custom id or id, and would fix both. On 4/18/21, Nicolas Goaziou wrote: > Hello, > > Samuel Wa

Re: stability of toc links

2021-04-18 Thread Samuel Wales
i think this is the right type of solution. On 12/8/20, TEC wrote: > > Hi Sam, link stability is a concern I've had too. I currently have a fix > (or at the very least, an improvement) for this in my config where I > overwrite org-export-get-reference. (see: > https://tecosaur.github.io/emacs-con

Re: stability of toc links

2021-04-18 Thread Nicolas Goaziou
Hello, Samuel Wales writes: > when you link to a section using toc, you get a link like > > > https://thekafkapandemic.blogspot.com/2020/02/crimes-against-humanity_3.html#org080f0ab > > will these links break if somebody copies them and pastes them > elsewhere? what if you add a section? Th

Re: stability of toc links

2020-12-19 Thread Ihor Radchenko
Carsten Dominik writes: > Dear all, > > I am sorry, I have trouble finding the time to work on this - so if someone > else wants to look further into this, that would be great. > > Carsten FYI, there is also built-in generator for bibtex ids - bibtex-generate-autokey from bibtex.el. It does a pr

Re: stability of toc links

2020-12-18 Thread Carsten Dominik
Dear all, I am sorry, I have trouble finding the time to work on this - so if someone else wants to look further into this, that would be great. Carsten On Fri, Dec 11, 2020 at 8:51 AM Carsten Dominik wrote: > Dear all, > > let me test this a bit, and then I am going to proposa a patch. > > Ki

Re: stability of toc links

2020-12-14 Thread Dominique Dumont
On Wednesday, 9 December 2020 00:28:46 CET Samuel Wales wrote: > when you link to a section using toc, you get a link like > > https://thekafkapandemic.blogspot.com/2020/02/crimes-against-humanity_3.htm > l#org080f0ab > > will these links break if somebody copies them and pastes them > elsewhere

Re: stability of toc links

2020-12-12 Thread TRS-80
On 2020-12-12 16:51, TRS-80 wrote: "If we are not in MAJOR-MODE, exit with error." I noticed a small typo: - "If we are not in MAJOR-MODE, exit with error." + "If we are not in major MODE, exit with error." Cheers, TRS-80

Re: stability of toc links

2020-12-12 Thread TRS-80
On 2020-12-08 20:39, Tom Gillespie wrote: It sounds like you are looking for the CUSTOM_ID property. See https://orgmode.org/manual/Handling-Links.html and https://orgmode.org/manual/Internal-Links.html. I don't remember whether there is a way to generate ids matching headlines within org itself,

Re: stability of toc links

2020-12-10 Thread Carsten Dominik
Dear all, let me test this a bit, and then I am going to proposa a patch. Kind regards Carsten On Thu, Dec 10, 2020 at 3:38 PM TEC wrote: > > > There are a few touch ups I'll do to my code shortly > > I'm pleased to say that I've improved the readability and documentation > of my code (hopefu

Re: stability of toc links

2020-12-10 Thread TEC
> There are a few touch ups I'll do to my code shortly I'm pleased to say that I've improved the readability and documentation of my code (hopefully) in https://github.com/tecosaur/emacs-config/commit/dc873d3 I hope this may be of some help, Timothy

Re: stability of toc links

2020-12-10 Thread TEC
Carsten Dominik writes: > Yes, I mean this code, or something like this, to aid the automatic > creation of links that are somewhat stable. I have been missing this very > much. Hi Carsten, glad to hear that there /does/ seem to be interest in this after all :) A few things worth saying I t

Re: stability of toc links

2020-12-10 Thread Carsten Dominik
On Wed, Dec 9, 2020 at 10:25 PM Samuel Wales wrote: > just so everybody is on the same page, i think carsten is talking > about tec's code that generates html id's that are then used in urls? > Yes, I mean this code, or something like this, to aid the automatic creation of links that are somewha

Re: stability of toc links

2020-12-09 Thread Samuel Wales
just so everybody is on the same page, i think carsten is talking about tec's code that generates html id's that are then used in urls? imo great idea. On 12/9/20, Carsten Dominik wrote: > I think we should merge this code into Org. > > Kind regards > > Carsten > > On Wed, Dec 9, 2020 at 3:54 A

Re: stability of toc links

2020-12-09 Thread Carsten Dominik
I think we should merge this code into Org. Kind regards Carsten On Wed, Dec 9, 2020 at 3:54 AM TEC wrote: > > Hi Sam, link stability is a concern I've had too. I currently have a fix > (or at the very least, an improvement) for this in my config where I > overwrite org-export-get-reference. (

Re: stability of toc links

2020-12-09 Thread Diego Zamboni
In case it's useful, I have put together (just last week) some config to help in creating and using human-readable CUSTOM_IDs in conjunction with `counsel-org-link`, but which could just as easily be used to apply the IDs to every heading in the current document: https://github.com/zzamboni/dot-doo

Re: stability of toc links

2020-12-08 Thread TEC
Hi Sam, link stability is a concern I've had too. I currently have a fix (or at the very least, an improvement) for this in my config where I overwrite org-export-get-reference. (see: https://tecosaur.github.io/emacs-config/config.html#nicer-generated-heading). I raised this on the list a while

Re: stability of toc links

2020-12-08 Thread Tom Gillespie
It sounds like you are looking for the CUSTOM_ID property. See https://orgmode.org/manual/Handling-Links.html and https://orgmode.org/manual/Internal-Links.html. I don't remember whether there is a way to generate ids matching headlines within org itself, but there is https://github.com/alphapapa/u

Re: stability of toc links

2020-12-08 Thread Samuel Wales
just thought of a better, still bad, solution. you could use the header text itself. then if the link breaks, the user can at least go to the document and manually look for somethnign similar. On 12/8/20, Samuel Wales wrote: > when you link to a section using toc, you get a link like > > > http

stability of toc links

2020-12-08 Thread Samuel Wales
when you link to a section using toc, you get a link like https://thekafkapandemic.blogspot.com/2020/02/crimes-against-humanity_3.html#org080f0ab will these links break if somebody copies them and pastes them elsewhere? what if you add a section? there doesn't seem to be a perfect solution,