summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2012-01-18 10:24:57 -0500
committerShaun McCance <shaunm@gnome.org>2012-01-18 10:24:57 -0500
commite443f53b562251718b379c9c5c86f2c92fe23514 (patch)
treeae93b05d015bb46e4db60ca5d6b62d64fe4fdf3a /data
parent88ce1f33313ab58751038f4715b04c33c2247af6 (diff)
downloadyelp-e443f53b562251718b379c9c5c86f2c92fe23514.tar.gz
mal2html.xsl: Use new mal.link custom templates
Diffstat (limited to 'data')
-rw-r--r--data/xslt/mal2html.xsl.in56
1 files changed, 39 insertions, 17 deletions
diff --git a/data/xslt/mal2html.xsl.in b/data/xslt/mal2html.xsl.in
index cf7ab91a..efe8a7ad 100644
--- a/data/xslt/mal2html.xsl.in
+++ b/data/xslt/mal2html.xsl.in
@@ -19,30 +19,52 @@
<xsl:param name="mal.cache" select="yelp:input()"/>
-<!-- == mal.link.target == -->
-<xsl:template name="mal.link.target">
- <xsl:param name="link" select="."/>
- <xsl:param name="action" select="$link/@action"/>
- <xsl:param name="xref" select="$link/@xref"/>
- <xsl:param name="href" select="$link/@href"/>
+<xsl:param name="mal.link.prefix" select="'xref:'"/>
+<xsl:param name="mal.link.extension" select="''"/>
+
+<xsl:template name="mal.link.target.custom">
+ <xsl:param name="node" select="."/>
+ <xsl:param name="action" select="$node/@action"/>
+ <xsl:param name="xref" select="$node/@xref"/>
<xsl:choose>
<xsl:when test="starts-with($action, 'install:')">
<xsl:value-of select="$action"/>
</xsl:when>
- <xsl:when test="string($xref) = ''">
- <xsl:value-of select="$href"/>
+ <xsl:when test="starts-with($xref, 'ghelp:') or starts-with($xref, 'help:')">
+ <xsl:value-of select="$xref"/>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="mal.link.content.custom">
+ <xsl:param name="node" select="."/>
+ <xsl:param name="action" select="$node/@action"/>
+ <xsl:param name="xref" select="$node/@xref"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($action, 'install:')">
+ <!-- FIXME: i18n -->
+ <xsl:text>INSTALL </xsl:text>
+ <xsl:value-of select="substring($action, 9)"/>
</xsl:when>
- <xsl:when test="contains($xref, '/')">
- <xsl:value-of select="$href"/>
+ <xsl:when test="starts-with($xref, 'ghelp:') or starts-with($xref, 'help:')">
+ <xsl:value-of select="$xref"/>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="mal.link.tooltip.custom">
+ <xsl:param name="node" select="."/>
+ <xsl:param name="action" select="$node/@action"/>
+ <xsl:param name="xref" select="$node/@xref"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($action, 'install:')">
+ <!-- FIXME: i18n -->
+ <xsl:text>INSTALL </xsl:text>
+ <xsl:value-of select="substring($action, 9)"/>
</xsl:when>
- <xsl:when test="contains($xref, '#')">
- <xsl:variable name="pageid" select="substring-before($xref, '#')"/>
- <xsl:variable name="sectionid" select="substring-after($xref, '#')"/>
- <xsl:value-of select="concat('xref:', $pageid, '#', $sectionid)"/>
+ <xsl:when test="starts-with($xref, 'ghelp:') or starts-with($xref, 'help:')">
+ <xsl:value-of select="$xref"/>
</xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('xref:', $xref)"/>
- </xsl:otherwise>
</xsl:choose>
</xsl:template>