aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2023-11-02 18:14:38 +0100
committerUlrich Müller <ulm@gentoo.org>2023-11-05 17:43:32 +0100
commitbbe65af778d3201e21f0129b0864008164578e99 (patch)
tree578b2623c844c9a91bbc5d493e6ae1ba63bb5dab
parentdevbook.xsl: Fix links created by contentsTree extraction (diff)
downloaddevmanual-bbe65af778d3201e21f0129b0864008164578e99.tar.gz
devmanual-bbe65af778d3201e21f0129b0864008164578e99.tar.bz2
devmanual-bbe65af778d3201e21f0129b0864008164578e99.zip
devbook.xsl: Manipulate paths in getLastNode consistently
Directory paths are used everywhere else, so append text.xml only when actually accessing the file. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--devbook.xsl10
1 files changed, 5 insertions, 5 deletions
diff --git a/devbook.xsl b/devbook.xsl
index 626b97d..b50ecc5 100644
--- a/devbook.xsl
+++ b/devbook.xsl
@@ -809,12 +809,12 @@
<!-- This function recurses forward down nodes stopping at the very last include... -->
<xsl:param name="root"/>
<xsl:param name="path"/>
- <xsl:variable name="include" select="document(concat($root, $path))/guide/include[last()]/@href"/>
+ <xsl:variable name="include" select="document(concat($root, $path, 'text.xml'))/guide/include[last()]/@href"/>
<xsl:choose>
<xsl:when test="$include">
<xsl:call-template name="getLastNode">
<xsl:with-param name="root" select="$root"/>
- <xsl:with-param name="path" select="concat(substring-before($path, 'text.xml'), $include, 'text.xml')"/>
+ <xsl:with-param name="path" select="concat($path, $include)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
@@ -854,15 +854,15 @@
<xsl:variable name="myItem_path">
<xsl:call-template name="getLastNode">
<xsl:with-param name="root" select="$parentItem_path"/>
- <xsl:with-param name="path" select="concat($parentItem_next, 'text.xml')"/>
+ <xsl:with-param name="path" select="$parentItem_next"/>
</xsl:call-template>
</xsl:variable>
<!-- Make a relative <a> link; we need an absolute reference
for the XSLT processor though... -->
- <a class="w-250 text-center" href="{concat('../', substring-before($myItem_path, 'text.xml'), 'index.html')}">
+ <a class="w-250 text-center" href="{concat('../', $myItem_path, 'index.html')}">
<span class="fa fa-arrow-left"/>
<span class="truncated-text d-inline-block max-w-200 ml-2">
- <xsl:value-of select="document(concat($parentItem_path, $myItem_path))/guide/chapter[1]/title"/>
+ <xsl:value-of select="document(concat($parentItem_path, $myItem_path, 'text.xml'))/guide/chapter[1]/title"/>
</span>
</a>
</xsl:when>