Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916523 - Internal links created by <contentsTree root="" extraction="todo"/> are broken
Summary: Internal links created by <contentsTree root="" extraction="todo"/> are broken
Status: RESOLVED FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Devmanual (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Devmanual Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-30 09:10 UTC by Ulrich Müller
Modified: 2023-11-02 17:08 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2023-10-30 09:10:55 UTC
The links in the TODO list have the wrong depth, namely the depth calculated from the source file containing the <todo> element, not the depth relative to appendices/todo-list/. (This problem is currently masked by the fact that the only link in a todo element is in general-concepts/autotools/ which by chance is also at depth 2.)

To reproduce, add the following code to appendices/text.xml:

    <todo>
    <uri link="::quickstart/"/>
    </todo>

Resulting output in appendices/index.html:
<a class="" href="../quickstart/index.html">Quickstart Ebuild Guide</a>
This translates to https://devmanual.gentoo.org/quickstart/index.html (which is correct).

Resulting output in appendices/todo-list/index.html:
<a class="" href="../quickstart/index.html">Quickstart Ebuild Guide</a>
This translates to https://devmanual.gentoo.org/appendices/quickstart/index.html which is at the wrong depth level in the tree.
Comment 1 Larry the Git Cow gentoo-dev 2023-11-02 17:08:03 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=bcca132de057cf520806200b1bcb925b955b0966

commit bcca132de057cf520806200b1bcb925b955b0966
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2023-10-31 20:24:06 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2023-11-02 17:04:12 +0000

    devbook.xsl: Fix links created by contentsTree extraction
    
    If the element that is extracted from the external document contains
    internal references, these links would be relative to the wrong start
    location, namely the one defined in that document. Therefore, define
    our own copy of /guide/@self (pointing to the location of the target
    document), and rebase the tree onto it.
    
    This fixes the intra-document links in appendices/todo-list/.
    
    Closes: https://bugs.gentoo.org/916523
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 devbook.xsl | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)