Mike Gerwitz

Activist for User Freedom

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mtg@gnu.org>2015-09-29 22:51:47 -0400
committerMike Gerwitz <mtg@gnu.org>2015-09-29 22:52:09 -0400
commitca28680f79063c31cac2bdd9c7a47d06587f6797 (patch)
tree484efa3edab5f8f282d2958ab4b9bea969c50f21
parent10b270250fafd838b70be642a4057ae5f1e28871 (diff)
downloadliterate-xsl-ca28680f79063c31cac2bdd9c7a47d06587f6797.tar.gz
literate-xsl-ca28680f79063c31cac2bdd9c7a47d06587f6797.tar.bz2
literate-xsl-ca28680f79063c31cac2bdd9c7a47d06587f6797.zip
Add namespace to function/template Texinfo output
This allows users to actually...uh..._use_ it.
-rw-r--r--src/texinfo.xsl28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/texinfo.xsl b/src/texinfo.xsl
index 9dcb121..1ed8baf 100644
--- a/src/texinfo.xsl
+++ b/src/texinfo.xsl
@@ -119,6 +119,9 @@
<variable name="doc" as="xs:string?"
select="xt:get-docblock( . )" />
+ <variable name="xmlns" as="xs:string"
+ select="xt:get-xmlns-from-name( @name, . )" />
+
<variable name="param-str" as="xs:string"
select="string-join( xt:typed-param-str( xsl:param ),
', ' )" />
@@ -141,6 +144,8 @@
'@deftypefn ', name(), ' {', $type, '} ',
@name, ' (', $param-str, ')',
$xt:nl,
+ concat( '@t{', $xmlns, '}' ),
+ $xt:nl,
$doc,
$xt:nl,
'@emph{Definition:}',
@@ -157,6 +162,29 @@
<!--
+ Generate xmlns attribute for the namespace prefix of @var{name}
+-->
+<function name="xt:get-xmlns-from-name" as="xs:string">
+ <param name="name" as="xs:string" />
+ <param name="context" as="element()" />
+
+ <variable name="prefix" as="xs:string"
+ select="substring-before( $name, ':' )" />
+
+ <sequence select="concat(
+ 'xmlns',
+ ( if ( $prefix ) then
+ concat( ':', $prefix )
+ else
+ '' ),
+ '=&quot;',
+ namespace-uri-for-prefix(
+ $prefix, $context ),
+ '&quot;' )" />
+</function>
+
+
+<!--
Determine whether the given comment node is a docblock
We ignore anything that is not immediately adjacent to a template or