From: Marc 'B. R. <ma...@ri...> - 2016-04-01 10:38:24
|
On 01/04/16 00:54, Tom Roche wrote: > ISTM docutils should _always_ > > 1. for unique section names: generate `div id`s by `s/ /-/g` > 2. for duplicate section names (and all backrefs): generate `div > id`s by serial numbering, i.e. appending a serial number to > string='id' > > So my first question is, am I missing something? Is there a reason > to *not* behave thusly? If not: > > My second question is, is there any reason to believe that docutils > is *not* producing the above behavior? If so, please lemme know and I'll > put an `issue on restview <https://github.com/mgedmin/restview/issues>`_. > If not: > > My third question presumes this behavior is due to a problem with > docutils: is there anything else I should do to help get this fixed? Do > I need to make an issue in a tracker? or do something to further debug > the problem? or Something Completely Different? I would not rely on the way id attributes are generated at all. That's an implementation detail IMHO and it's also a HTML thing, so this breaks when generating a PDF via LaTeX anyway. In the case presented you don't even have to do this because the link text matched the heading linked, so you can simply omit the link directives. Those are also responsible for the "reference external" instead of "reference internal" classes on the links. A workaround would be to move the link directives after the headlines, then docutils sees the headlines first and generates the ID(s) as you expect them to be. Ciao, Marc 'BlackJack' Rintsch -- “Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life.” -- Terry Pratchett, Jingo |