Mike Gerwitz

Activist for User Freedom

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mtg@gnu.org>2015-09-28 23:58:59 -0400
committerMike Gerwitz <mtg@gnu.org>2015-09-28 23:58:59 -0400
commit88b1a9ba49b1c070987753aff8d7a531d205a0d7 (patch)
tree59323b6cb9cb85b14d64a88fb637aa53173cdfd1
parent30daa3c1d91a1c49dbe7b8bfd491d0565a661a34 (diff)
downloadliterate-xsl-88b1a9ba49b1c070987753aff8d7a531d205a0d7.tar.gz
literate-xsl-88b1a9ba49b1c070987753aff8d7a531d205a0d7.tar.bz2
literate-xsl-88b1a9ba49b1c070987753aff8d7a531d205a0d7.zip
Account for parity in Texinfo function anchor
-rw-r--r--src/texinfo.xsl16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/texinfo.xsl b/src/texinfo.xsl
index eeca20f..f17cf5f 100644
--- a/src/texinfo.xsl
+++ b/src/texinfo.xsl
@@ -111,8 +111,8 @@
@code{xs:sequence()}. Parameters are output in a style consistent
with the XPath specification.
- An anchor will also be generated using the namespace prefix and
- local name, which allows for easy and intuitive referencing.
+ An anchor will also be generated using the name and (for functions) arity,
+ which allows for easy and intuitive referencing.
-->
<template mode="xt:doc-gen" priority="5"
match="xsl:template|xsl:function">
@@ -126,10 +126,18 @@
<variable name="type" as="xs:string"
select="if ( @as ) then @as else 'xs:sequence*'" />
+ <variable name="anchor" as="xs:string"
+ select="if ( . instance of element( xsl:function ) ) then
+ concat( @name, ':', count( xsl:param ) )
+ else
+ @name" />
+
<value-of select="concat(
$xt:nl,
- '@anchor{', @name, '}',
- $xt:nl,
+ ( if ( not( $anchor = '' ) ) then
+ concat( '@anchor{', $anchor, '}', $xt:nl )
+ else
+ '' ),
'@deftypefn ', name(), ' {', $type, '} ',
@name, ' (', $param-str, ')',
$xt:nl,