+++ /dev/null
-README for db2man by Martijn van Beers (lotr@users.sourceforge.net)
-
-I've been working on some stylesheets to convert <refentry>s to man
-format. I thought I'd submit what I have for inclusion in the
-docbook-xsl package.
-
-See also:
-
- http://sourceforge.net/tracker/index.php?func=detail&aid=468779&group_id=21935&atid=373749
-
+++ /dev/null
-<?xml version='1.0'?>
-<!-- vim:set sts=2 shiftwidth=2 syntax=sgml: -->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version='1.0'>
-
-<!-- Needed for chunker.xsl (for now): -->
-<xsl:param name="output.method" select="'text'"/>
-<xsl:param name="default.encoding" select="'ISO-8859-1'"/>
-<xsl:param name="saxon.character.representation" select="'entity;decimal'"/>
-<xsl:param name="chunk.quietly" select="'0'"/>
-
-<xsl:include href="http://docbook.sourceforge.net/release/xsl/current/common/common.xsl"/>
-<xsl:include href="http://docbook.sourceforge.net/release/xsl/current/html/chunker.xsl"/>
-
-<xsl:include href="synop.xsl"/>
-<xsl:include href="lists.xsl"/>
-<xsl:include href="xref.xsl"/>
-
-<xsl:output method="text"
- encoding="ISO-8859-1"
- indent="no"/>
-
-<!--
- named templates for bold and italic. call like:
-
- <xsl:apply-templates mode="bold" select="node-you-want" />
--->
-<xsl:template mode="bold" match="*">
- <xsl:text>\fB</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>\fR</xsl:text>
-</xsl:template>
-
-<xsl:template mode="italic" match="*">
- <xsl:text>\fI</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>\fR</xsl:text>
-</xsl:template>
-
-<xsl:template match="refsect2">
- <xsl:text> .SS "</xsl:text>
- <xsl:value-of select="title[1]"/>
- <xsl:text>" </xsl:text>
- <xsl:apply-templates/>
-</xsl:template>
-
-<xsl:template match="caution|important|note|tip|warning">
- <xsl:text> .RS .Sh "</xsl:text>
- <!-- capitalize word -->
- <xsl:value-of
- select="translate (substring (name(.), 1, 1), 'cintw', 'CINTW')" />
- <xsl:value-of select="substring (name(), 2)" />
- <xsl:if test="title">
- <xsl:text>: </xsl:text>
- <xsl:value-of select="title[1]"/>
- </xsl:if>
- <xsl:text>" </xsl:text>
- <xsl:apply-templates/>
- <xsl:text> .RE </xsl:text>
-</xsl:template>
-
-<xsl:template match="refsect1">
- <xsl:text> .SH "</xsl:text>
- <xsl:value-of select="translate(title[1],'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
- <xsl:text>"
-</xsl:text>
- <xsl:apply-templates/>
-</xsl:template>
-
-<xsl:template match="refsynopsisdiv">
- <xsl:text> .SH "SYNOPSIS" </xsl:text>
- <xsl:apply-templates/>
-</xsl:template>
-
-
-<xsl:template match="para">
- <xsl:text> .PP </xsl:text>
- <xsl:for-each select="node()">
- <xsl:choose>
- <xsl:when test="self::screen|self::programlisting|self::itemizedlist|self::orderedlist|self::variablelist">
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:when test="self::text()">
- <xsl:if test="starts-with(translate(.,' ',' '), ' ') and
- preceding-sibling::node()[name(.)!='']">
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:variable name="content">
- <xsl:apply-templates select="."/>
- </xsl:variable>
- <xsl:value-of select="normalize-space($content)"/>
- <xsl:if
- test="translate(substring(., string-length(.), 1),' ',' ') = ' ' and
- following-sibling::node()[name(.)!='']">
- <xsl:text> </xsl:text>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="content">
- <xsl:apply-templates select="."/>
- </xsl:variable>
- <xsl:value-of select="normalize-space($content)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:text> </xsl:text>
-</xsl:template>
-
-<xsl:template match="simpara">
- <xsl:variable name="content">
- <xsl:apply-templates/>
- </xsl:variable>
- <xsl:text> </xsl:text>
- <xsl:value-of select="normalize-space($content)"/>
- <xsl:text>
-</xsl:text>
-</xsl:template>
-
-
-<xsl:template match="refentry">
- <xsl:variable name="section" select="refmeta/manvolnum"/>
- <xsl:variable name="name" select="refnamediv/refname[1]"/>
-
- <xsl:variable name="title">
- <xsl:choose>
- <xsl:when test="refentryinfo/title">
- <xsl:value-of select="refentryinfo/title"/>
- </xsl:when>
- <xsl:when test="../referenceinfo/title">
- <xsl:value-of select="../referenceinfo/title"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="date">
- <xsl:choose>
- <xsl:when test="refentryinfo/date">
- <xsl:value-of select="refentryinfo/date"/>
- </xsl:when>
- <xsl:when test="../referenceinfo/date">
- <xsl:value-of select="../referenceinfo/date"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="productname">
- <xsl:choose>
- <xsl:when test="refentryinfo/productname">
- <xsl:value-of select="refentryinfo/productname"/>
- </xsl:when>
- <xsl:when test="../referenceinfo/productname">
- <xsl:value-of select="../referenceinfo/productname"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:call-template name="write.text.chunk">
- <xsl:with-param name="filename"
- select="concat(normalize-space ($name), '.', $section)"/>
- <xsl:with-param name="content">
- <xsl:text>.\"Generated by db2man.xsl. Don't modify this, modify the source.
-.de Sh \" Subsection
-.br
-.if t .Sp
-.ne 5
-.PP
-\fB\\$1\fR
-.PP
-..
-.de Sp \" Vertical space (when we can't use .PP)
-.if t .sp .5v
-.if n .sp
-..
-.de Ip \" List item
-.br
-.ie \\n(.$>=3 .ne \\$3
-.el .ne 3
-.IP "\\$1" \\$2
-..
-.TH "</xsl:text>
- <xsl:value-of select="translate(refmeta/refentrytitle,'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
- <xsl:text>" </xsl:text>
- <xsl:value-of select="refmeta/manvolnum[1]"/>
- <xsl:text> "</xsl:text>
- <xsl:value-of select="$date"/>
- <xsl:text>" "</xsl:text>
- <xsl:value-of select="$productname"/>
- <xsl:text>" "</xsl:text>
- <xsl:value-of select="$title"/>
- <xsl:text>"
-</xsl:text>
- <xsl:apply-templates/>
- <xsl:text> </xsl:text>
-
- <!-- Author section -->
- <xsl:choose>
- <xsl:when test="refentryinfo//author">
- <xsl:apply-templates select="refentryinfo" mode="authorsect"/>
- </xsl:when>
- <xsl:when test="/book/bookinfo//author">
- <xsl:apply-templates select="/book/bookinfo" mode="authorsect"/>
- </xsl:when>
- <xsl:when test="/article/articleinfo//author">
- <xsl:apply-templates select="/article/articleinfo" mode="authorsect"/>
- </xsl:when>
- </xsl:choose>
-
- </xsl:with-param>
- </xsl:call-template>
- <!-- Now generate stub include pages for every page documented in
- this refentry (except the page itself) -->
- <xsl:for-each select="refnamediv/refname">
- <xsl:if test=". != $name">
- <xsl:call-template name="write.text.chunk">
- <xsl:with-param name="filename"
- select="concat(normalize-space(.), '.', $section)"/>
- <xsl:with-param name="content" select="concat('.so man',
- $section, '/', $name, '.', $section, ' ')"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
-</xsl:template>
-
-<xsl:template match="refmeta"></xsl:template>
-<xsl:template match="title"></xsl:template>
-<xsl:template match="abstract"></xsl:template>
-
-<xsl:template match="articleinfo|bookinfo|refentryinfo" mode="authorsect">
- <xsl:text>.SH AUTHOR</xsl:text>
- <xsl:if test="count(.//author)>1">
- <xsl:text>S</xsl:text>
- </xsl:if>
- <xsl:text> </xsl:text>
-
- <xsl:for-each select=".//author">
- <xsl:if test="position() > 1">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="normalize-space(.)"/>
- </xsl:for-each>
- <xsl:text>. </xsl:text>
- <xsl:if test=".//editor">
- <xsl:text>.br Man page edited by </xsl:text>
- <xsl:apply-templates select=".//editor"/>
- <xsl:text>. </xsl:text>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="author|editor">
- <xsl:call-template name="person.name"/>
- <xsl:apply-templates select="./affiliation/address/email" />
-</xsl:template>
-
-<xsl:template match="copyright">
- <xsl:text>Copyright </xsl:text>
- <xsl:apply-templates select="./year" />
- <xsl:text> .Sp </xsl:text>
-</xsl:template>
-
-<xsl:template match="email">
- <xsl:text> <</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>></xsl:text>
-</xsl:template>
-
-<xsl:template match="refnamediv">
- <xsl:text>.SH NAME </xsl:text>
- <xsl:for-each select="refname">
- <xsl:if test="position()>1">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <xsl:value-of select="."/>
- </xsl:for-each>
- <xsl:text> \- </xsl:text>
- <xsl:value-of select="normalize-space (refpurpose)"/>
-</xsl:template>
-
-<xsl:template match="refentry/refentryinfo"></xsl:template>
-
-<xsl:template match="option">
- <xsl:apply-templates mode="bold" select="."/>
-</xsl:template>
-
-<xsl:template match="replaceable|varname">
- <xsl:apply-templates mode="italic" select="."/>
-</xsl:template>
-
-<xsl:template match="filename">
- <xsl:text> .FN </xsl:text><xsl:apply-templates/>
-</xsl:template>
-
-<xsl:template match="userinput">
- <xsl:apply-templates mode="bold" select="."/>
-</xsl:template>
-
-<xsl:template match="informalexample|screen">
- <xsl:text> .IP .nf </xsl:text>
- <xsl:apply-templates/>
- <xsl:text> .fi </xsl:text>
-</xsl:template>
-
-<xsl:template match="envar">
- <xsl:apply-templates mode="bold" select="."/>
-</xsl:template>
-
-<xsl:template match="filename">
- <xsl:apply-templates mode="italic" select="."/>
-</xsl:template>
-
-<xsl:template match="errorcode|constant|type">
- <xsl:apply-templates mode="bold" select="."/>
-</xsl:template>
-
-<xsl:template match="quote">
- <xsl:text>``</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>''</xsl:text>
-</xsl:template>
-
-<xsl:template match="programlisting">
- <xsl:text> .nf </xsl:text>
- <xsl:apply-templates/>
- <xsl:text> .fi </xsl:text>
-</xsl:template>
-
-<xsl:template name="do-citerefentry">
- <xsl:param name="refentrytitle" select="''"/>
- <xsl:param name="manvolnum" select="''"/>
-
- <xsl:apply-templates mode="bold" select="$refentrytitle"/>
- <xsl:text>(</xsl:text>
- <xsl:value-of select="$manvolnum"/>
- <xsl:text>)</xsl:text>
-</xsl:template>
-
-<xsl:template match="citerefentry">
- <xsl:call-template name="do-citerefentry">
- <xsl:with-param name="refentrytitle" select="refentrytitle"/>
- <xsl:with-param name="manvolnum" select="manvolnum"/>
- </xsl:call-template>
-</xsl:template>
-
-<xsl:template match="ulink">
- <xsl:variable name="content">
- <xsl:apply-templates/>
- </xsl:variable>
- <xsl:if test="$content != ''">
- <xsl:text>: </xsl:text>
- <xsl:value-of select="$content" />
- </xsl:if>
- <xsl:apply-templates mode="italic" select="@url" />
-</xsl:template>
-
-<!-- Translate some entities to textual equivalents. -->
-<xsl:template name="replace-string">
- <xsl:param name="content" select="''"/>
- <xsl:param name="replace" select="''"/>
- <xsl:param name="with" select="''"/>
- <xsl:choose>
- <xsl:when test="not(contains($content,$replace))">
- <xsl:value-of select="$content"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-before($content,$replace)"/>
- <xsl:value-of select="$with"/>
- <xsl:call-template name="replace-string">
- <xsl:with-param name="content"
- select="substring-after($content,$replace)"/>
- <xsl:with-param name="replace" select="$replace"/>
- <xsl:with-param name="with" select="$with"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="replace-mdash">
- <xsl:param name="content" select="''"/>
- <xsl:call-template name="replace-string">
- <xsl:with-param name="content" select="$content"/>
- <xsl:with-param name="replace" select="'—'"/>
- <xsl:with-param name="with" select="'--'"/>
- </xsl:call-template>
-</xsl:template>
-
-<xsl:template name="replace-hellip">
- <xsl:param name="content" select="''"/>
- <xsl:call-template name="replace-string">
- <xsl:with-param name="content" select="$content"/>
- <xsl:with-param name="replace" select="'…'"/>
- <xsl:with-param name="with" select="'...'"/>
- </xsl:call-template>
-</xsl:template>
-
-<xsl:template name="replace-setmn">
- <xsl:param name="content" select="''"/>
- <xsl:call-template name="replace-string">
- <xsl:with-param name="content" select="$content"/>
- <xsl:with-param name="replace" select="'∖'"/>
- <xsl:with-param name="with" select="'\\'"/>
- </xsl:call-template>
-</xsl:template>
-
-<xsl:template name="replace-minus">
- <xsl:param name="content" select="''"/>
- <xsl:value-of select="translate($content,'−','-')"/>
-</xsl:template>
-
-<xsl:template name="replace-backslash">
- <xsl:param name="content" select="''"/>
- <xsl:call-template name="replace-string">
- <xsl:with-param name="content" select="$content"/>
- <xsl:with-param name="replace" select="'\'"/>
- <xsl:with-param name="with" select="'\\'"/>
- </xsl:call-template>
-</xsl:template>
-
-<xsl:template name="replace-entities">
- <xsl:param name="content" select="''"/>
- <xsl:call-template name="replace-hellip">
- <xsl:with-param name="content">
- <xsl:call-template name="replace-minus">
- <xsl:with-param name="content">
- <xsl:call-template name="replace-mdash">
- <xsl:with-param name="content">
- <xsl:call-template name="replace-setmn">
- <xsl:with-param name="content">
- <xsl:call-template name="replace-backslash">
- <xsl:with-param name="content" select="$content"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
-</xsl:template>
-
-<xsl:template match="text()">
- <xsl:call-template name="replace-entities">
- <xsl:with-param name="content">
- <xsl:value-of select="."/>
- </xsl:with-param>
- </xsl:call-template>
-</xsl:template>
-
-<xsl:template match="/">
- <xsl:choose>
- <xsl:when test="//refentry">
- <xsl:apply-templates select="//refentry"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>No refentry elements!</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version='1.0'?>
-<!-- vim:set sts=2 shiftwidth=2 syntax=sgml: -->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version='1.0'>
-
-<xsl:template match="para|simpara|remark" mode="list">
- <xsl:variable name="foo">
- <xsl:apply-templates/>
- </xsl:variable>
- <xsl:value-of select="normalize-space($foo)"/>
- <xsl:text> </xsl:text>
- <xsl:if test="following-sibling::para or following-sibling::simpara or
- following-sibling::remark">
- <!-- Make sure multiple paragraphs within a list item don't -->
- <!-- merge together. -->
- <xsl:text> </xsl:text>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="varlistentry|glossentry">
- <xsl:text> .TP </xsl:text>
- <xsl:apply-templates/>
-</xsl:template>
-
-<xsl:template match="variablelist|glosslist" mode="list">
- <xsl:text> .RS </xsl:text>
- <xsl:apply-templates/>
- <xsl:text> .RE </xsl:text>
-</xsl:template>
-
-<xsl:template match="varlistentry/term|glossterm">
- <xsl:variable name="content">
- <xsl:apply-templates/>
- </xsl:variable>
- <xsl:value-of select="normalize-space($content)"/>
- <xsl:text>, </xsl:text>
-</xsl:template>
-
-<xsl:template
- match="varlistentry/term[position()=last()]|glossterm[position()=last()]"
- priority="2">
- <xsl:variable name="content">
- <xsl:apply-templates/>
- </xsl:variable>
- <xsl:value-of select="normalize-space($content)"/>
-</xsl:template>
-
-<xsl:template match="varlistentry/listitem|glossdef">
- <xsl:text> </xsl:text>
- <xsl:apply-templates mode="list"/>
-</xsl:template>
-
-<xsl:template match="itemizedlist/listitem">
- <xsl:text>\(bu </xsl:text>
- <xsl:apply-templates mode="list"/>
- <xsl:if test="position()!=last()">
- <xsl:text>.TP </xsl:text>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="orderedlist/listitem|procedure/step">
- <xsl:number format="1."/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates mode="list"/>
- <xsl:if test="position()!=last()">
- <xsl:text>.TP </xsl:text>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="itemizedlist|orderedlist|procedure">
- <xsl:text> .TP 3 </xsl:text>
- <xsl:apply-templates/>
- <xsl:text>.LP </xsl:text>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version='1.0'?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version='1.0'>
-
-<xsl:template match="refsect2">
- <xsl:text> .Sh "</xsl:text>
- <xsl:value-of select="substring-before(title[1],' ')"/>
- <xsl:text>" </xsl:text>
- <xsl:apply-templates/>
-</xsl:template>
-<xsl:template match="refsect2/title"></xsl:template>
-<xsl:template match="refsect2/programlisting"></xsl:template>
-
-<xsl:template match="funcsynopsis">
- <xsl:text> .BI "</xsl:text>
- <xsl:apply-templates/>
-</xsl:template>
-
-<xsl:template match="funcsynopsis/funcprototype">
- <xsl:apply-templates/>
- <xsl:text> ); .br </xsl:text>
-</xsl:template>
-
-<xsl:template match="funcsynopsis/funcprototype/funcdef">
- <xsl:apply-templates/>
- <xsl:value-of select="function"/>
- <xsl:text> (</xsl:text>
-</xsl:template>
-<xsl:template match="funcsynopsis/funcprototype/funcdef/function"></xsl:template>
-
-<xsl:template match="funcsynopsis/funcprototype/paramdef">
- <xsl:apply-templates/>
- <xsl:text>" </xsl:text>
- <xsl:value-of select="parameter"/>
- <xsl:choose>
- <xsl:when test="following-sibling::paramdef">
- <xsl:text> ", </xsl:text>
- </xsl:when>
- </xsl:choose>
-</xsl:template>
-<xsl:template match="funcsynopsis/funcprototype/paramdef/parameter"></xsl:template>
-
-<xsl:template match="refsect2/informaltable/tgroup/tbody/row">
- <xsl:text>.Ip "\(bu \s-1</xsl:text>
- <xsl:value-of select="entry[1]/parameter[1]"/>
- <xsl:text>\s0 \- </xsl:text>
- <xsl:value-of select="normalize-space(entry[2])"/>
- <xsl:text>" </xsl:text>
-</xsl:template>
-
-<xsl:template match="refsect1">
- <xsl:text> .SH "</xsl:text>
- <xsl:value-of select="translate(title[1],'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
- <xsl:text>" </xsl:text>
- <xsl:apply-templates/>
-</xsl:template>
-
-<xsl:template match="refsynopsisdiv">
- <xsl:text> .SH "</xsl:text>
- <xsl:value-of select="translate(title[1],'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
- <xsl:text>" </xsl:text>
- <xsl:apply-templates/>
-</xsl:template>
-<xsl:template match="refsynopsisdiv/title"></xsl:template>
-
-<xsl:template match="refsect1/title"></xsl:template>
-
-<xsl:template match="para">
- <xsl:text>.PP </xsl:text>
- <xsl:apply-templates/>
-</xsl:template>
-
-<xsl:template match="*"><xsl:apply-templates/></xsl:template>
-
-<xsl:template match="refentry">
- <xsl:text>." DO NOT MODIFY THIS FILE!
-.de Sh \" Subsection
-.br
-.if t .Sp
-.ne 5
-.PP
-\fB\\$1\fR
-.PP
-..
-.de Sp \" Vertical space (when we can't use .PP)
-.if t .sp .5v
-.if n .sp
-..
-.de Ip \" List item
-.br
-.ie \\n(.$>=3 .ne \\$3
-.el .ne 3
-.IP "\\$1" \\$2
-..
-.TH "</xsl:text>
- <xsl:value-of select="refmeta/refentrytitle[1]"/>
- <xsl:text>" </xsl:text>
- <xsl:value-of select="refmeta/manvolnum[1]"/>
- <xsl:text> "</xsl:text>
- <xsl:value-of select="@revision"/>
- <xsl:text>" </xsl:text>
- <xsl:apply-templates/>
-</xsl:template>
-
-<xsl:template match="refmeta"></xsl:template>
-
-<xsl:template match="refnamediv">
- <xsl:text>.SH NAME </xsl:text>
- <xsl:value-of select="refname"/>
- <xsl:text> \- </xsl:text>
- <xsl:value-of select="refpurpose"/>
-</xsl:template>
-
-<xsl:template match="refentry/refentrytitle"></xsl:template>
-<xsl:template match="article/articleinfo/*"></xsl:template>
-
-<xsl:template match="term/option">
- <xsl:text>\fB</xsl:text><xsl:apply-templates/><xsl:text>\fR</xsl:text>
-</xsl:template>
-
-<xsl:template match="varlistentry">
- <xsl:text> .TP </xsl:text>
-<xsl:apply-templates select="./term"/>
-<xsl:apply-templates select="./listitem"/>
-</xsl:template>
-
-<xsl:template match="varlistentry/listitem/para">
- <xsl:apply-templates/>
-</xsl:template>
-
-<xsl:template match="filename">
- <xsl:text> .FN </xsl:text><xsl:apply-templates/>
-</xsl:template>
-
-<xsl:template match="userinput">
- <xsl:text> .IP .B </xsl:text><xsl:apply-templates/>
-</xsl:template>
-
-<xsl:template match="envar">
- <xsl:text>\fB</xsl:text><xsl:apply-templates/><xsl:text>\fR</xsl:text>
-</xsl:template>
-
-<xsl:template match="filename">
- <xsl:text>\fI</xsl:text><xsl:apply-templates/><xsl:text>\fR</xsl:text>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version='1.0'?>
-<!-- vim:set sts=2 shiftwidth=2 syntax=sgml: -->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version='1.0'>
-
-<xsl:template match="synopfragment">
-<xsl:text> .PP </xsl:text>
-<xsl:apply-templates/>
-</xsl:template>
-<!--
- there's a bug were an <arg> that's not inside a <group> isn't made bold
--->
-
-<xsl:template match="group|arg">
- <xsl:variable name="choice" select="@choice"/>
- <xsl:variable name="rep" select="@rep"/>
- <xsl:variable name="sepchar">
- <xsl:choose>
- <xsl:when test="ancestor-or-self::*/@sepchar">
- <xsl:value-of select="ancestor-or-self::*/@sepchar"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text> </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="position()>1"><xsl:value-of select="$sepchar"/></xsl:if>
- <xsl:choose>
- <xsl:when test="$choice='plain'">
- <!-- do nothing -->
- </xsl:when>
- <xsl:when test="$choice='req'">
- <xsl:value-of select="$arg.choice.req.open.str"/>
- </xsl:when>
- <xsl:when test="$choice='opt'">
- <xsl:value-of select="$arg.choice.opt.open.str"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$arg.choice.def.open.str"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:variable name="arg">
- <xsl:apply-templates/>
- </xsl:variable>
- <xsl:value-of select="normalize-space($arg)"/>
- <xsl:choose>
- <xsl:when test="$rep='repeat'">
- <xsl:value-of select="$arg.rep.repeat.str"/>
- </xsl:when>
- <xsl:when test="$rep='norepeat'">
- <xsl:value-of select="$arg.rep.norepeat.str"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$arg.rep.def.str"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="$choice='plain'">
- <xsl:if test='arg'>
- <xsl:value-of select="$arg.choice.plain.close.str"/>
- </xsl:if>
- </xsl:when>
- <xsl:when test="$choice='req'">
- <xsl:value-of select="$arg.choice.req.close.str"/>
- </xsl:when>
- <xsl:when test="$choice='opt'">
- <xsl:value-of select="$arg.choice.opt.close.str"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$arg.choice.def.close.str"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="group/arg">
- <xsl:if test="position()>1">
- <xsl:value-of select="$arg.or.sep"/>
- </xsl:if>
- <!-- Don't use the 'bold' named template here since there may be -->
- <!-- child elements that require different markup (such as -->
- <!-- <replaceable>). -->
- <xsl:text>\fB</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>\fR</xsl:text>
-</xsl:template>
-
-<xsl:template match="command">
- <xsl:apply-templates mode="bold" select="."/>
-</xsl:template>
-
-<xsl:template match="function[not(ancestor::command)]">
- <xsl:apply-templates mode="bold" select="."/>
-</xsl:template>
-
-<xsl:template match="parameter[not(ancestor::command)]">
- <xsl:apply-templates mode="italic" select="."/>
-</xsl:template>
-
-<xsl:template match="sbr">
- <xsl:variable name="cmd" select="ancestor::cmdsynopsis/command"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="translate($cmd,$cmd,' ')"/>
-</xsl:template>
-
-<xsl:template name="wrap-cmd">
- <xsl:param name="indent" select="''"/>
- <xsl:param name="text" select="''"/>
- <xsl:param name="allow" select="75"/>
- <xsl:param name="width" select="$allow - string-length($indent)"/>
- <xsl:variable name="total" select="string-length($text)"/>
- <xsl:variable name="split"
- select="substring($text,$width+1,$total - $width)"/>
- <xsl:variable name="fragment" select="substring-before($split,' ')"/>
- <xsl:variable name="line">
- <xsl:value-of select="substring($text,1,$width)"/>
- <xsl:choose>
- <xsl:when test="$fragment!=''">
- <xsl:value-of select="$fragment"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$split"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$split=''">
- <xsl:value-of select="$line"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$line"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="$indent"/>
- <xsl:variable name="done" select="string-length($line)"/>
- <xsl:variable name="remaining" select="$total - $done + 1"/>
- <xsl:call-template name="wrap-cmd">
- <xsl:with-param name="indent" select="$indent"/>
- <xsl:with-param name="text"
- select="substring($text,1+$done,$remaining)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="cmdsynopsis">
- <xsl:text> .nf </xsl:text>
- <xsl:choose>
- <xsl:when test=".//sbr">
- <!-- The author has put explicit formatting hints in for us. -->
- <xsl:apply-templates/>
- </xsl:when>
- <xsl:otherwise>
- <!-- Try to do some smart formatting. -->
- <xsl:variable name="cmdsynopsis">
- <xsl:apply-templates/>
- </xsl:variable>
- <xsl:variable name="cmd" select="command"/>
- <xsl:variable name="indent"
- select="translate($cmd,$cmd,' ')"/>
- <xsl:text>\fB</xsl:text>
- <xsl:value-of select="$cmd"/><xsl:text>\fR </xsl:text>
- <xsl:call-template name="wrap-cmd">
- <xsl:with-param name="indent" select="$indent"/>
- <xsl:with-param name="text" select="substring-after($cmdsynopsis,' ')"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text> .fi </xsl:text>
-</xsl:template>
-
-<xsl:template match="synopsis">
- <xsl:text> .nf </xsl:text>
- <xsl:apply-templates/>
- <xsl:text> .fi </xsl:text>
-</xsl:template>
-
-<xsl:template match="void">
- <xsl:text>void</xsl:text>
-</xsl:template>
-
-<xsl:template match="varargs">
- <xsl:text>...</xsl:text>
-</xsl:template>
-
-<xsl:template match="funcsynopsisinfo">
- <xsl:text> </xsl:text>
- <xsl:apply-templates/>
- <xsl:text> .sp </xsl:text>
-</xsl:template>
-
-<!-- disable hyphenation, and use left-aligned filling for the duration
- of the synopsis, so that line breaks only occur between
- separate paramdefs. -->
-<xsl:template match="funcsynopsis">
- <xsl:text>.ad l .hy 0 </xsl:text>
- <xsl:apply-templates/>
- <xsl:text>.ad .hy </xsl:text>
-</xsl:template>
-
-<!-- TODO: Handle K&R-style parameter lists
- Comment that used to go with the paramdef template, which
- is now obsolete and thus deleted
--->
-
-<!-- evaluates to parameter string with all space characters converted
- to non-breaking spaces. -->
-<xsl:template name="nbspace">
- <xsl:param name="string" select="''"/>
- <xsl:choose>
- <xsl:when test="contains($string, ' ')">
- <xsl:value-of select="substring-before($string, ' ')"/>
- <xsl:text>\ </xsl:text>
- <xsl:call-template name="nbspace">
- <xsl:with-param name="string" select="substring-after($string, ' ')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$string"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- replaces all spaces within the funcdef/paramdef with non-breaking
- spaces -->
-<xsl:template match="paramdef|funcdef">
- <xsl:variable name="content">
- <xsl:apply-templates select="*|./*|text()"/>
- </xsl:variable>
- <xsl:call-template name="nbspace">
- <xsl:with-param name="string" select="$content"/>
- </xsl:call-template>
- <xsl:if test="local-name(.) = 'paramdef' and
- (following-sibling::paramdef or following-sibling::varargs)">
- <xsl:text>, </xsl:text>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="funcprototype">
- <xsl:variable name="funcprototype">
- <xsl:apply-templates select="funcdef"/>
- </xsl:variable>
- <xsl:text>.HP </xsl:text>
- <xsl:value-of select="string-length (normalize-space ($funcprototype)) - 5"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="normalize-space ($funcprototype)"/>
- <xsl:text>\ (</xsl:text>
- <xsl:apply-templates select="void|paramdef|varargs"/>
- <xsl:text>); </xsl:text>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version='1.0'?>
-<!-- vim:set sts=2 shiftwidth=2 syntax=sgml: -->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version='1.0'>
-
-<xsl:template match="xref">
- <xsl:variable name="targets" select="id(@linkend)"/>
- <xsl:variable name="target" select="$targets[1]"/>
- <xsl:variable name="type" select="local-name($target)"/>
-
- <xsl:choose>
- <xsl:when test="$type=''">
- <xsl:message>
- <xsl:text>xref to nonexistent id </xsl:text>
- <xsl:value-of select="@linkend"/>
- </xsl:message>
- </xsl:when>
-
- <xsl:when test="$type='refentry'">
- <xsl:call-template name="do-citerefentry">
- <xsl:with-param name="refentrytitle"
- select="$target/refmeta/refentrytitle[1]"/>
- <xsl:with-param name="manvolnum"
- select="$target/refmeta/manvolnum"/>
- </xsl:call-template>
- </xsl:when>
-
- <xsl:when test="$type='refname'">
- <xsl:call-template name="do-citerefentry">
- <xsl:with-param name="refentrytitle" select="$target"/>
- <xsl:with-param name="manvolnum"
- select="$target/../../refmeta/manvolnum"/>
- </xsl:call-template>
- </xsl:when>
-
- <xsl:otherwise>
- <xsl:text>[xref to </xsl:text>
- <xsl:value-of select="$type"/>
- <xsl:text>]</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-</xsl:stylesheet>