|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
-->
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
|
|
Packit |
e4b6da |
xmlns:date="http://exslt.org/dates-and-times"
|
|
Packit |
e4b6da |
xmlns="http://docbook2x.sourceforge.net/xmlns/Man-XML"
|
|
Packit |
e4b6da |
exclude-result-prefixes="doc date"
|
|
Packit |
e4b6da |
version='1.0'
|
|
Packit |
e4b6da |
xml:lang="en">
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
$Id: refentry.xsl,v 1.19 2006/04/21 02:39:55 stevecheng Exp $
|
|
Packit |
e4b6da |
********************************************************************
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
(C) 2000-2004 Steve Cheng <stevecheng@users.sourceforge.net>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
This file is part of the docbook2X XSLT stylesheets for
|
|
Packit |
e4b6da |
converting DocBook to man pages.
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
See ../../COPYING for the copyright status of this software.
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
******************************************************************** -->
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<doc:reference xmlns="">
|
|
Packit |
e4b6da |
<title><sgmltag class="element">refentry</sgmltag> markup</title>
|
|
Packit |
e4b6da |
</doc:reference>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="reference">
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
man pages (particularly coming from doclifter),
|
|
Packit |
e4b6da |
then we will lowercase the filename (title) of the man page -->
|
|
Packit |
e4b6da |
<xsl:template name="refentry-filename">
|
|
Packit |
e4b6da |
<xsl:param name="title" />
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:variable name="title2" select="translate($title, " /", "__")" />
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
accented chars / non-Latin chars ...
|
|
Packit |
e4b6da |
if they do I think you've got more serious problems :) -->
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
select="'abcdefghijklmnopqrstuvwxyz'" />
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:choose>
|
|
Packit |
e4b6da |
<xsl:when test="not($lowercase-file)">
|
|
Packit |
e4b6da |
<xsl:value-of select="$title2" />
|
|
Packit |
e4b6da |
</xsl:when>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:when test="translate($title2, $lowercase-alphabet, '') = $title2">
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
select="translate($title2, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
|
Packit |
e4b6da |
$lowercase-alphabet)" />
|
|
Packit |
e4b6da |
</xsl:when>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:otherwise>
|
|
Packit |
e4b6da |
<xsl:value-of select="$title2" />
|
|
Packit |
e4b6da |
</xsl:otherwise>
|
|
Packit |
e4b6da |
</xsl:choose>
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="refentry">
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:variable name="title">
|
|
Packit |
e4b6da |
<xsl:choose>
|
|
Packit |
e4b6da |
<xsl:when test="./refmeta">
|
|
Packit |
e4b6da |
<xsl:apply-templates select="./refmeta/refentrytitle" />
|
|
Packit |
e4b6da |
</xsl:when>
|
|
Packit |
e4b6da |
<xsl:otherwise>
|
|
Packit |
e4b6da |
<xsl:apply-templates select="./refnamediv/refname[1]" />
|
|
Packit |
e4b6da |
</xsl:otherwise>
|
|
Packit |
e4b6da |
</xsl:choose>
|
|
Packit |
e4b6da |
</xsl:variable>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:call-template name="manpage">
|
|
Packit |
e4b6da |
<xsl:with-param name="title">
|
|
Packit |
e4b6da |
<xsl:call-template name="refentry-filename">
|
|
Packit |
e4b6da |
<xsl:with-param name="title" select="$title" />
|
|
Packit |
e4b6da |
</xsl:call-template>
|
|
Packit |
e4b6da |
</xsl:with-param>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:with-param name="h1" select="$title" />
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:with-param name="section">
|
|
Packit |
e4b6da |
<xsl:choose>
|
|
Packit |
e4b6da |
<xsl:when test="./refmeta/manvolnum">
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
mode="header-text" />
|
|
Packit |
e4b6da |
</xsl:when>
|
|
Packit |
e4b6da |
<xsl:otherwise>
|
|
Packit |
e4b6da |
<xsl:value-of select="$default-manpage-section" />
|
|
Packit |
e4b6da |
</xsl:otherwise>
|
|
Packit |
e4b6da |
</xsl:choose>
|
|
Packit |
e4b6da |
</xsl:with-param>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:with-param name="h3">
|
|
Packit |
e4b6da |
<xsl:choose>
|
|
Packit |
e4b6da |
<xsl:when test="$header-3 != ''">
|
|
Packit |
e4b6da |
<xsl:value-of select="$header-3" />
|
|
Packit |
e4b6da |
</xsl:when>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:when test="refmeta/refmiscinfo[@class='date']">
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
select="(refmeta/refmiscinfo[@class='date'])[1]"
|
|
Packit |
e4b6da |
mode="header-text" />
|
|
Packit |
e4b6da |
</xsl:when>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:when test="(refentryinfo/date | docinfo/date)">
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
select="(refentryinfo/date | docinfo/date)[1]"
|
|
Packit |
e4b6da |
mode="header-text" />
|
|
Packit |
e4b6da |
</xsl:when>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:otherwise>
|
|
Packit |
e4b6da |
<xsl:if test="function-available('date:date')">
|
|
Packit |
e4b6da |
<xsl:value-of select="date:day-in-month()" />
|
|
Packit |
e4b6da |
<xsl:text> </xsl:text>
|
|
Packit |
e4b6da |
<xsl:value-of select="date:month-name()" />
|
|
Packit |
e4b6da |
<xsl:text> </xsl:text>
|
|
Packit |
e4b6da |
<xsl:value-of select="date:year()" />
|
|
Packit |
e4b6da |
</xsl:if>
|
|
Packit |
e4b6da |
</xsl:otherwise>
|
|
Packit |
e4b6da |
</xsl:choose>
|
|
Packit |
e4b6da |
</xsl:with-param>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:with-param name="h4">
|
|
Packit |
e4b6da |
<xsl:choose>
|
|
Packit |
e4b6da |
<xsl:when test="$header-4 != ''">
|
|
Packit |
e4b6da |
<xsl:value-of select="$header-4" />
|
|
Packit |
e4b6da |
</xsl:when>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:when test="refmeta/refmiscinfo[not(@class='manual' or @class='date')]">
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
select="(refmeta/refmiscinfo[not(@class='manual' or @class='date')])[1]"
|
|
Packit |
e4b6da |
mode="header-text" />
|
|
Packit |
e4b6da |
</xsl:when>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:otherwise>
|
|
Packit |
e4b6da |
</xsl:otherwise>
|
|
Packit |
e4b6da |
</xsl:choose>
|
|
Packit |
e4b6da |
</xsl:with-param>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:with-param name="h5">
|
|
Packit |
e4b6da |
<xsl:choose>
|
|
Packit |
e4b6da |
<xsl:when test="$header-5 != ''">
|
|
Packit |
e4b6da |
<xsl:value-of select="$header-5" />
|
|
Packit |
e4b6da |
</xsl:when>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:when test="refmeta/refmiscinfo[@class='manual']">
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
select="(refmeta/refmiscinfo[@class='manual'])[1]"
|
|
Packit |
e4b6da |
mode="header-text" />
|
|
Packit |
e4b6da |
</xsl:when>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:otherwise>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
"Linux Programmer's Manual", so using
|
|
Packit |
e4b6da |
the title here should be correct -->
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
mode="header-text" />
|
|
Packit |
e4b6da |
</xsl:otherwise>
|
|
Packit |
e4b6da |
</xsl:choose>
|
|
Packit |
e4b6da |
</xsl:with-param>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
</xsl:call-template>
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="*" mode="header-text">
|
|
Packit |
e4b6da |
<xsl:apply-templates mode="header-text" />
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="text()" mode="header-text">
|
|
Packit |
e4b6da |
<xsl:value-of select="." />
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="refmeta">
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="refentrytitle">
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:apply-templates />
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="manvolnum">
|
|
Packit |
e4b6da |
<xsl:text>(</xsl:text>
|
|
Packit |
e4b6da |
<xsl:apply-templates/>
|
|
Packit |
e4b6da |
<xsl:text>)</xsl:text>
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="refmiscinfo">
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="refnamediv">
|
|
Packit |
e4b6da |
<xsl:call-template name="SH-section">
|
|
Packit |
e4b6da |
<xsl:with-param name="title">
|
|
Packit |
e4b6da |
<xsl:call-template name="uppercase-title">
|
|
Packit |
e4b6da |
<xsl:with-param name="content">
|
|
Packit |
e4b6da |
<xsl:call-template name="gentext-title" />
|
|
Packit |
e4b6da |
</xsl:with-param>
|
|
Packit |
e4b6da |
</xsl:call-template>
|
|
Packit |
e4b6da |
</xsl:with-param>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:with-param name="content">
|
|
Packit |
e4b6da |
<refnameline>
|
|
Packit |
e4b6da |
<xsl:apply-templates select="refname|refpurpose" />
|
|
Packit |
e4b6da |
</refnameline>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:apply-templates select="refclass" />
|
|
Packit |
e4b6da |
</xsl:with-param>
|
|
Packit |
e4b6da |
</xsl:call-template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="refname">
|
|
Packit |
e4b6da |
<refname>
|
|
Packit |
e4b6da |
<xsl:apply-templates />
|
|
Packit |
e4b6da |
</refname>
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="refpurpose">
|
|
Packit |
e4b6da |
<refpurpose>
|
|
Packit |
e4b6da |
<xsl:apply-templates />
|
|
Packit |
e4b6da |
</refpurpose>
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="refdescriptor">
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="refclass">
|
|
Packit |
e4b6da |
<para>
|
|
Packit |
e4b6da |
<xsl:if test="@role">
|
|
Packit |
e4b6da |
<xsl:value-of select="@role"/>
|
|
Packit |
e4b6da |
<xsl:text>: </xsl:text>
|
|
Packit |
e4b6da |
</xsl:if>
|
|
Packit |
e4b6da |
<xsl:apply-templates/>
|
|
Packit |
e4b6da |
</para>
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="refsynopsisdiv">
|
|
Packit |
e4b6da |
<xsl:call-template name="SH-section">
|
|
Packit |
e4b6da |
<xsl:with-param name="title">
|
|
Packit |
e4b6da |
<xsl:choose>
|
|
Packit |
e4b6da |
<xsl:when test="title">
|
|
Packit |
e4b6da |
<xsl:apply-templates select="title" mode="title" />
|
|
Packit |
e4b6da |
</xsl:when>
|
|
Packit |
e4b6da |
<xsl:otherwise>
|
|
Packit |
e4b6da |
<xsl:call-template name="uppercase-title">
|
|
Packit |
e4b6da |
<xsl:with-param name="content">
|
|
Packit |
e4b6da |
<xsl:call-template name="gentext-title" />
|
|
Packit |
e4b6da |
</xsl:with-param>
|
|
Packit |
e4b6da |
</xsl:call-template>
|
|
Packit |
e4b6da |
</xsl:otherwise>
|
|
Packit |
e4b6da |
</xsl:choose>
|
|
Packit |
e4b6da |
</xsl:with-param>
|
|
Packit |
e4b6da |
</xsl:call-template>
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="refsection">
|
|
Packit |
e4b6da |
<xsl:call-template name="SH-section" />
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="refsect1">
|
|
Packit |
e4b6da |
<xsl:call-template name="SH-section" />
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:template match="refsect2">
|
|
Packit |
e4b6da |
<xsl:call-template name="SS-section" />
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
name="uppercase-title"
|
|
Packit |
e4b6da |
mode="title">
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:param name="content" select="." />
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
<xsl:choose>
|
|
Packit |
e4b6da |
<xsl:when test="$uppercase-headings">
|
|
Packit |
e4b6da |
<xsl:call-template name="ucase">
|
|
Packit |
e4b6da |
<xsl:with-param name="content" select="$content" />
|
|
Packit |
e4b6da |
</xsl:call-template>
|
|
Packit |
e4b6da |
</xsl:when>
|
|
Packit |
e4b6da |
<xsl:otherwise>
|
|
Packit |
e4b6da |
<xsl:value-of select="$content" />
|
|
Packit |
e4b6da |
</xsl:otherwise>
|
|
Packit |
e4b6da |
</xsl:choose>
|
|
Packit |
e4b6da |
</xsl:template>
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
|
|
Packit |
e4b6da |
</xsl:stylesheet>
|