Mike Gerwitz

Activist for User Freedom

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mtg@gnu.org>2015-09-29 00:03:05 -0400
committerMike Gerwitz <mtg@gnu.org>2015-09-29 00:03:40 -0400
commit32ae0ec8ce401a9e99b6cd0c44093941fbdd67ba (patch)
tree48b77c31edb4ea26f0e3d13e676e58756932f19d
parent30daa3c1d91a1c49dbe7b8bfd491d0565a661a34 (diff)
parente27e4460068b5e3d787a10110eba96a11dee4681 (diff)
downloadliterate-xsl-32ae0ec8ce401a9e99b6cd0c44093941fbdd67ba.tar.gz
literate-xsl-32ae0ec8ce401a9e99b6cd0c44093941fbdd67ba.tar.bz2
literate-xsl-32ae0ec8ce401a9e99b6cd0c44093941fbdd67ba.zip
Texinfo function documentation fixes and changes
-rw-r--r--src/texinfo.xsl26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/texinfo.xsl b/src/texinfo.xsl
index eeca20f..ad04147 100644
--- a/src/texinfo.xsl
+++ b/src/texinfo.xsl
@@ -2,7 +2,7 @@
<!--@comment
Texinfo documentation generator for XSL stylesheets
- Copyright (C) 2014 LoVullo Associates, Inc.
+ Copyright (C) 2014, 2015 LoVullo Associates, Inc.
This file is part of xslink.
@@ -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,15 +126,25 @@
<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,
$doc,
$xt:nl,
+ '@emph{Definition:}',
+ $xt:nl,
'@verbatim',
$xt:nl,
xt:serialize( . ),
@@ -181,8 +191,10 @@
<function name="xt:get-docblock" as="comment()?">
<param name="context" as="node()" />
- <sequence select="$context/preceding-sibling::comment()[1][
- xt:is-docblock( . ) ]" />
+ <sequence select="( ( $context/preceding-sibling::node()[
+ not( . instance of text() ) ] )
+ [ last() ] )
+ [ . instance of comment() ]" />
</function>