2 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
3 xmlns:
exsl=
"http://exslt.org/common"
5 exclude-result-prefixes=
"exsl">
7 <xsl:import href=
"http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
8 <xsl:import href=
"stylesheet-common.xsl" />
13 <xsl:param name=
"man.authors.section.enabled">0</xsl:param>
14 <xsl:param name=
"man.copyright.section.enabled">0</xsl:param>
15 <xsl:param name=
"man.endnotes.are.numbered">0</xsl:param> <!-- for performance -->
16 <xsl:param name=
"man.output.base.dir"></xsl:param>
17 <xsl:param name=
"man.output.in.separate.dir" select=
"1"></xsl:param>
18 <xsl:param name=
"man.output.quietly" select=
"1"></xsl:param>
19 <xsl:param name=
"man.th.title.max.length">32</xsl:param> <!-- enough room for "CREATE TEXT SEARCH CONFIGURATION" -->
20 <xsl:param name=
"man.th.extra3.max.length">40</xsl:param> <!-- enough room for "PostgreSQL X.Ydevel Documentation" -->
21 <xsl:param name=
"refentry.meta.get.quietly" select=
"0"></xsl:param>
22 <xsl:param name=
"refentry.xref.manvolnum" select=
"1"/> <!-- overridden from stylesheet-common.xsl -->
24 <!-- Fixup for apostrophe groff output. See the following references:
25 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=457839>
26 <https://sourceforge.net/tracker/?func=detail&aid=2412738&group_id=21935&atid=373747>
28 <xsl:param name=
"man.string.subst.map.local.post">
29 <substitution oldstring=
"\'" newstring=
"\(aq"></substitution>
33 <!-- Custom templates -->
35 <!-- Improve output of email element. See also
36 <https://sourceforge.net/tracker/?func=detail&aid=3524417&group_id=21935&atid=373747>
38 <xsl:template match=
"email">
39 <xsl:text><</xsl:text>
40 <xsl:apply-templates/>
41 <xsl:text>></xsl:text>
45 <!-- Make superscripts visible in man pages (default is no decoration) -->
46 <xsl:template match=
"superscript">
47 <xsl:text>^
</xsl:text>
48 <xsl:apply-templates/>
52 <xsl:template match=
"refentry" mode=
"xref-to">
53 <xsl:param name=
"referrer"/>
54 <xsl:param name=
"xrefstyle"/>
57 <!-- If the refname contains a space, we construct a reference
58 like CREATE DATABASE (CREATE_DATABASE(7)), so the reader
59 knows both the command name being referred to and the name of
60 the man page to read about it. -->
61 <xsl:when test=
"contains(refnamediv/refname[1],' ')">
62 <xsl:variable name=
"mangled.title">
63 <xsl:value-of select=
"translate(refnamediv/refname[1],' ','_')"/>
65 <xsl:apply-templates select=
"refnamediv/refname[1]"/>
66 <xsl:text> (
</xsl:text>
67 <xsl:call-template name=
"bold">
68 <xsl:with-param name=
"node" select=
"exsl:node-set($mangled.title)"/>
69 <xsl:with-param name=
"context" select=
"."/>
71 <xsl:apply-templates select=
"refmeta/manvolnum"/>
72 <xsl:text>)
</xsl:text>
75 <!-- This is the original case, except that boldness has been
76 added, per the convention mentioned in man-pages(7). -->
79 <xsl:when test=
"refmeta/refentrytitle">
80 <xsl:call-template name=
"bold">
81 <xsl:with-param name=
"node" select=
"refmeta/refentrytitle"/>
82 <xsl:with-param name=
"context" select=
"."/>
86 <xsl:call-template name=
"bold">
87 <xsl:with-param name=
"node" select=
"refnamediv/refname[1]"/>
88 <xsl:with-param name=
"context" select=
"."/>
92 <xsl:apply-templates select=
"refmeta/manvolnum"/>
99 <!-- For refentries we don't man to generate a man page for, leave out
100 manvolnum, let it default to 0, and skip writing out man files
103 <!-- overridden from common/refentry.xsl -->
104 <xsl:template name=
"get.refentry.section">
106 <xsl:when test=
"refmeta/manvolnum">
107 <xsl:value-of select=
"refmeta/manvolnum"/>
110 <xsl:text>0</xsl:text>
115 <!-- overridden from manpages/other.xsl -->
116 <xsl:template name=
"write.man.file">
117 <xsl:param name=
"name"/>
118 <xsl:param name=
"section"/>
119 <xsl:param name=
"lang"/>
120 <xsl:param name=
"content"/>
121 <xsl:param name=
"filename">
122 <xsl:call-template name=
"make.adjusted.man.filename">
123 <xsl:with-param name=
"name" select=
"$name"/>
124 <xsl:with-param name=
"section" select=
"$section"/>
125 <xsl:with-param name=
"lang" select=
"$lang"/>
128 <xsl:if test=
"$section != 0">
129 <xsl:call-template name=
"write.text.chunk">
130 <xsl:with-param name=
"filename" select=
"$filename"/>
131 <xsl:with-param name=
"suppress-context-node-name" select=
"1"/>
132 <xsl:with-param name=
"quiet" select=
"$man.output.quietly"/>
134 name=
"message-prolog"
135 >Note:
</xsl:with-param>
136 <xsl:with-param name=
"encoding" select=
"$man.output.encoding"/>
137 <xsl:with-param name=
"content" select=
"$content"/>
143 <!-- Overridden template as workaround for this problem:
144 <https://sourceforge.net/tracker/?func=detail&aid=2831602&group_id=21935&atid=373747>
146 <xsl:template name=
"write.stubs">
147 <xsl:param name=
"first.refname"/>
148 <xsl:param name=
"section"/>
149 <xsl:param name=
"lang"/>
150 <xsl:for-each select=
"refnamediv/refname">
151 <xsl:if test=
". != $first.refname">
152 <xsl:call-template name=
"write.text.chunk">
153 <xsl:with-param name=
"filename">
154 <xsl:call-template name=
"make.adjusted.man.filename">
155 <xsl:with-param name=
"name" select=
"."/>
156 <xsl:with-param name=
"section" select=
"$section"/>
157 <xsl:with-param name=
"lang" select=
"$lang"/>
160 <xsl:with-param name=
"quiet" select=
"$man.output.quietly"/>
161 <xsl:with-param name=
"suppress-context-node-name" select=
"1"/>
162 <xsl:with-param name=
"message-prolog">Note:
</xsl:with-param>
163 <xsl:with-param name=
"message-epilog"> (soelim stub)
</xsl:with-param>
164 <xsl:with-param name=
"content">
166 <xsl:when test=
"$man.output.in.separate.dir = 0">
167 <xsl:value-of select=
"concat('.so man', $section, '/')"/>
170 <xsl:value-of select=
"'.so '"/> <!-- added case -->
173 <xsl:call-template name=
"make.adjusted.man.filename">
174 <xsl:with-param name=
"name" select=
"$first.refname"/>
175 <xsl:with-param name=
"section" select=
"$section"/>
177 <xsl:text> </xsl:text>
185 <!-- https://sourceforge.net/tracker/?func=detail&aid=3545150&group_id=21935&atid=373747 -->
186 <xsl:template match=
"step/title">
187 <xsl:apply-templates/>
188 <xsl:text>:
</xsl:text>
192 <!-- http://sourceforge.net/p/docbook/bugs/1340/ -->
193 <xsl:template match=
"indexterm"/>
196 <!-- https://github.com/docbook/xslt10-stylesheets/issues/59 -->
197 <xsl:template match=
"a/sup">
198 <xsl:apply-templates/>
202 <!-- Gentext customization -->
204 <!-- see http://www.sagehill.net/docbookxsl/CustomGentext.html -->
205 <xsl:param name=
"local.l10n.xml" select=
"document('')"/>
206 <l:i18n xmlns:
l=
"http://docbook.sourceforge.net/xmlns/l10n/1.0">
207 <l:l10n language=
"en">
208 <!-- Use ISO 8601 date format. -->
209 <l:context name=
"datetime">
210 <l:template name=
"format" text=
"Y-m-d"/>
213 <!-- Slight rephrasing to indicate that missing sections are found
214 in the documentation. -->
215 <l:context name=
"xref-number-and-title">
216 <l:template name=
"chapter" text=
"Chapter %n, %t, in the documentation"/>
217 <l:template name=
"sect1" text=
"Section %n, “%t”, in the documentation"/>
218 <l:template name=
"sect2" text=
"Section %n, “%t”, in the documentation"/>
219 <l:template name=
"sect3" text=
"Section %n, “%t”, in the documentation"/>
220 <l:template name=
"sect4" text=
"Section %n, “%t”, in the documentation"/>
221 <l:template name=
"sect5" text=
"Section %n, “%t”, in the documentation"/>