Debian Codegraph @

xslt/docbook/html/db2html-refentry.xsl

raw
1 <?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
2 <!--
3 This program is free software; you can redistribute it and/or modify it under
4 the terms of the GNU Lesser General Public License as published by the Free
5 Software Foundation; either version 2 of the License, or (at your option) any
6 later version.
7
8 This program is distributed in the hope that it will be useful, but WITHOUT
9 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11 details.
12
13 You should have received a copy of the GNU Lesser General Public License
14 along with this program; see the file COPYING.LGPL. If not, see <http://www.gnu.org/licenses/>.
15 -->
16
17 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
18 xmlns:db="http://docbook.org/ns/docbook"
19 xmlns:set="http://exslt.org/sets"
20 xmlns="http://www.w3.org/1999/xhtml"
21 exclude-result-prefixes="db set"
22 version="1.0">
23
24 <!--!!==========================================================================
25 DocBook to HTML - Reference Pages
26
27 REMARK: Describe this module. Talk about refenty and friends
28 -->
29
30 <!--#% db2html.division.div.content.mode -->
31
32
33 <!-- == Matched Templates == -->
34
35 <!-- = citerefentry = -->
36 <xsl:template match="citerefentry | db:citerefentry">
37 <xsl:call-template name="db2html.inline"/>
38 </xsl:template>
39 <xsl:template match="citerefentry/refentrytitle | db:citerefentry/db:refentrytitle">
40 <xsl:call-template name="db2html.inline"/>
41 </xsl:template>
42
43 <!-- = manvolnum = -->
44 <xsl:template match="manvolnum | db:manvolnum">
45 <xsl:text>(</xsl:text>
46 <xsl:apply-templates select="node()"/>
47 <xsl:text>)</xsl:text>
48 </xsl:template>
49
50 <!-- = refentry = -->
51 <xsl:template match="refentry | db:refentry">
52 <xsl:param name="depth_in_chunk">
53 <xsl:call-template name="db.chunk.depth-in-chunk"/>
54 </xsl:param>
55 <xsl:param name="depth_of_chunk">
56 <xsl:call-template name="db.chunk.depth-of-chunk"/>
57 </xsl:param>
58 <xsl:call-template name="db2html.division.div">
59 <xsl:with-param name="divisions"
60 select="refsynopsisdiv | refsection | refsect1 |
61 db:refsynopsisdiv | db:refsection | db:refsect1"/>
62 <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
63 <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
64 </xsl:call-template>
65 </xsl:template>
66
67 <!-- = refentry % db2html.division.div.content.mode = -->
68 <xsl:template mode="db2html.division.div.content.mode" match="refentry |
69 db:refentry">
70 <xsl:param name="depth_in_chunk">
71 <xsl:call-template name="db.chunk.depth-in-chunk"/>
72 </xsl:param>
73 <xsl:param name="depth_of_chunk">
74 <xsl:call-template name="db.chunk.depth-of-chunk"/>
75 </xsl:param>
76 <div class="refnamedivs">
77 <xsl:apply-templates select="refnamediv | db:refnamediv">
78 <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk + 1"/>
79 <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
80 </xsl:apply-templates>
81 </div>
82 </xsl:template>
83
84 <!-- = refdescriptor = -->
85 <xsl:template match="refdescriptor | db:refdescriptor">
86 <xsl:call-template name="db2html.inline"/>
87 </xsl:template>
88
89 <!-- = refname = -->
90 <xsl:template match="refname | db:refname">
91 <xsl:call-template name="db2html.inline"/>
92 </xsl:template>
93
94 <!-- = refnamediv = -->
95 <xsl:template match="refnamediv | db:refnamediv">
96 <xsl:param name="depth_in_chunk">
97 <xsl:call-template name="db.chunk.depth-in-chunk"/>
98 </xsl:param>
99 <xsl:param name="depth_of_chunk">
100 <xsl:call-template name="db.chunk.depth-of-chunk"/>
101 </xsl:param>
102 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
103 <xsl:if test="$if != ''">
104 <div>
105 <xsl:call-template name="html.class.attr">
106 <xsl:with-param name="class" select="'refnamediv'"/>
107 </xsl:call-template>
108 <xsl:call-template name="db2html.anchor"/>
109 <xsl:choose>
110 <xsl:when test="refdescriptor">
111 <xsl:apply-templates select="refdescriptor"/>
112 </xsl:when>
113 <xsl:when test="db:refdescriptor">
114 <xsl:apply-templates select="db:refdescriptor"/>
115 </xsl:when>
116 <xsl:otherwise>
117 <xsl:for-each select="refname | db:refname">
118 <xsl:if test="position() != 1">
119 <xsl:call-template name="l10n.gettext">
120 <xsl:with-param name="msgid" select="', '"/>
121 </xsl:call-template>
122 </xsl:if>
123 <xsl:apply-templates select="."/>
124 </xsl:for-each>
125 </xsl:otherwise>
126 </xsl:choose>
127 <xsl:call-template name="l10n.gettext">
128 <xsl:with-param name="msgid" select="' — '"/>
129 </xsl:call-template>
130 <xsl:apply-templates select="refpurpose | db:refpurpose"/>
131 </div>
132 </xsl:if>
133 <!-- FIXME: what to do with refclass? -->
134 </xsl:template>
135
136 <!-- = refpurpose = -->
137 <xsl:template match="refpurpose | db:refpurpose">
138 <xsl:call-template name="db2html.inline"/>
139 </xsl:template>
140
141 <!-- = refsect1 = -->
142 <xsl:template match="refsect1 | db:refsect1">
143 <xsl:param name="depth_in_chunk">
144 <xsl:call-template name="db.chunk.depth-in-chunk"/>
145 </xsl:param>
146 <xsl:param name="depth_of_chunk">
147 <xsl:call-template name="db.chunk.depth-of-chunk"/>
148 </xsl:param>
149 <xsl:call-template name="db2html.division.div">
150 <xsl:with-param name="divisions" select="refsect2 | db:refsect2"/>
151 <xsl:with-param name="info" select="refsect1info | db:info"/>
152 <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
153 <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
154 <xsl:with-param name="chunk_divisions" select="false()"/>
155 </xsl:call-template>
156 </xsl:template>
157
158 <!-- = refsect2 = -->
159 <xsl:template match="refsect2 | db:refsect2">
160 <xsl:param name="depth_in_chunk">
161 <xsl:call-template name="db.chunk.depth-in-chunk"/>
162 </xsl:param>
163 <xsl:param name="depth_of_chunk">
164 <xsl:call-template name="db.chunk.depth-of-chunk"/>
165 </xsl:param>
166 <xsl:call-template name="db2html.division.div">
167 <xsl:with-param name="divisions" select="refsect3 | db:refsect3"/>
168 <xsl:with-param name="info" select="refsect2info | db:info"/>
169 <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
170 <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
171 <xsl:with-param name="chunk_divisions" select="false()"/>
172 </xsl:call-template>
173 </xsl:template>
174
175 <!-- = refsect3 = -->
176 <xsl:template match="refsect3 | db:refsect3">
177 <xsl:param name="depth_in_chunk">
178 <xsl:call-template name="db.chunk.depth-in-chunk"/>
179 </xsl:param>
180 <xsl:param name="depth_of_chunk">
181 <xsl:call-template name="db.chunk.depth-of-chunk"/>
182 </xsl:param>
183 <xsl:call-template name="db2html.division.div">
184 <xsl:with-param name="divisions" select="/false"/>
185 <xsl:with-param name="info" select="refsect3info | db:info"/>
186 <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
187 <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
188 <xsl:with-param name="chunk_divisions" select="false()"/>
189 </xsl:call-template>
190 </xsl:template>
191
192 <!-- = refsection = -->
193 <xsl:template match="refsection | db:refsection">
194 <xsl:param name="depth_in_chunk">
195 <xsl:call-template name="db.chunk.depth-in-chunk"/>
196 </xsl:param>
197 <xsl:param name="depth_of_chunk">
198 <xsl:call-template name="db.chunk.depth-of-chunk"/>
199 </xsl:param>
200 <xsl:call-template name="db2html.division.div">
201 <xsl:with-param name="divisions" select="refsection | db:refsection"/>
202 <xsl:with-param name="info" select="refsectioninfo | db:info"/>
203 <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
204 <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
205 <xsl:with-param name="chunk_divisions" select="false()"/>
206 </xsl:call-template>
207 </xsl:template>
208
209 <!-- = refsynopsisdiv = -->
210 <xsl:template match="refsynopsisdiv | db:refsynopsisdiv">
211 <xsl:param name="depth_in_chunk">
212 <xsl:call-template name="db.chunk.depth-in-chunk"/>
213 </xsl:param>
214 <xsl:param name="depth_of_chunk">
215 <xsl:call-template name="db.chunk.depth-of-chunk"/>
216 </xsl:param>
217 <xsl:call-template name="db2html.division.div">
218 <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
219 <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
220 </xsl:call-template>
221 </xsl:template>
222
223 </xsl:stylesheet>