switch to a 60 bit hash
[httpd-crcsyncproxy.git] / docs / manual / style / latex / synopsis.xsl
blobdd1ddddb7feeb705a4a14e41a4ba85e6b18472fc
1 <?xml version="1.0"?>
3 <!--
4 Licensed to the Apache Software Foundation (ASF) under one or more
5 contributor license agreements. See the NOTICE file distributed with
6 this work for additional information regarding copyright ownership.
7 The ASF licenses this file to You under the Apache License, Version 2.0
8 (the "License"); you may not use this file except in compliance with
9 the License. You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 -->
20 <xsl:stylesheet version="1.0"
21 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
22 xmlns="http://www.w3.org/1999/xhtml">
25 <!-- ==================================================================== -->
26 <!-- <modulesynopsis> -->
27 <!-- ==================================================================== -->
29 <xsl:template match="modulesynopsis">
31 <xsl:text>\section{</xsl:text>
32 <xsl:choose>
33 <xsl:when test="../status='Core'">
34 <xsl:value-of select="$message[@id='apachecore']" />
35 </xsl:when>
36 <xsl:when test=".='mpm_common'">
37 <xsl:value-of select="$message[@id='apachempmcommon']" />
38 </xsl:when>
39 <xsl:when test="../status='MPM'">
40 <xsl:value-of select="$message[@id='apachempm']" />
41 <xsl:text> </xsl:text>
42 <xsl:apply-templates select="name"/>
43 </xsl:when>
44 <xsl:otherwise>
45 <xsl:value-of select="$message[@id='apachemodule']" />
46 <xsl:text> </xsl:text>
47 <xsl:apply-templates select="name"/>
48 </xsl:otherwise>
49 </xsl:choose>
50 <xsl:text>}\label{</xsl:text>
51 <xsl:value-of select="concat('/mod/',name)"/>
52 <xsl:text>}\hypertarget{</xsl:text>
53 <xsl:value-of select="concat('/mod/',name)"/>
54 <xsl:text>}{}</xsl:text>
56 <xsl:text>
57 \begin{tabular}{lp{.75\linewidth}}
58 \hline
59 </xsl:text>
60 <xsl:value-of select="$message[@id='description']" />
61 <xsl:text>: &amp;</xsl:text>
62 <xsl:apply-templates select="description" />
63 <xsl:text>\\
64 </xsl:text>
66 <xsl:value-of select="$message[@id='status']" />
67 <xsl:text>: &amp;</xsl:text>
68 <xsl:variable name="status" select="translate(
69 status, $uppercase, $lowercase)"/>
70 <xsl:value-of select="$message[@id=$status]"/>
71 <xsl:text>\\
72 </xsl:text>
74 <xsl:if test="identifier">
75 <xsl:value-of select="$message[@id='moduleidentifier']" />
76 <xsl:text>: &amp;</xsl:text>
77 <xsl:apply-templates select="identifier" />
78 <xsl:text>\\
79 </xsl:text>
80 </xsl:if>
82 <xsl:if test="sourcefile">
83 <xsl:value-of select="$message[@id='sourcefile']" />
84 <xsl:text>: &amp;</xsl:text>
85 <xsl:apply-templates select="sourcefile" />
86 <xsl:text>\\
87 </xsl:text>
88 </xsl:if>
90 <xsl:if test="compatibility">
91 <xsl:value-of select="$message[@id='compatibility']" />
92 <xsl:text>: &amp;</xsl:text>
93 <xsl:apply-templates select="compatibility" />
94 <xsl:text> \\
95 </xsl:text>
96 </xsl:if>
97 <xsl:text>\hline \end{tabular}
98 </xsl:text>
99 <!-- Summary of module features/usage (1 to 3 paragraphs, -->
100 <!-- optional) -->
101 <xsl:if test="summary">
102 <xsl:text>\subsection*{</xsl:text>
103 <xsl:value-of select="$message[@id='summary']" />
104 <xsl:text>}
105 </xsl:text>
106 <xsl:apply-templates select="summary" />
107 </xsl:if>
109 <xsl:text>
110 \smallskip\textbf{</xsl:text>
111 <xsl:value-of select="$message[@id='directives']" />
112 <xsl:text>}
113 </xsl:text>
115 <xsl:choose>
116 <xsl:when test="directivesynopsis">
117 <xsl:text>\begin{itemize}</xsl:text>
118 <xsl:for-each select="directivesynopsis">
119 <xsl:sort select="name" />
120 <xsl:text>\item </xsl:text>
121 <xsl:if test="@type='section'">
122 <xsl:text>\textless{}</xsl:text>
123 </xsl:if>
124 <xsl:apply-templates select="name" mode="simple"/>
125 <xsl:if test="@type='section'">
126 <xsl:text>\textgreater{}</xsl:text>
127 </xsl:if>
128 <xsl:if test="@location">
129 <xsl:variable name="lowerlocation"
130 select="translate(@location, $uppercase, $lowercase)" />
131 <xsl:text> (p.\ \pageref{/mod/</xsl:text>
132 <xsl:value-of select="concat(translate(@location,$uppercase,$lowercase),':',translate(name,$uppercase,$lowercase))"/>
133 <xsl:text>}) </xsl:text>
134 </xsl:if>
135 <xsl:text>
136 </xsl:text>
137 </xsl:for-each>
138 <xsl:text>\end{itemize}
139 </xsl:text>
140 </xsl:when>
141 <xsl:otherwise>
142 <xsl:value-of select="$message[@id='nodirectives']" />
143 <xsl:text>
144 </xsl:text>
145 </xsl:otherwise>
146 </xsl:choose>
148 <xsl:text>
149 </xsl:text>
151 <xsl:call-template name="seealso"/>
153 <!-- Sections of documentation about the module as a whole -->
154 <xsl:apply-templates select="section" />
156 <!-- Directive documentation -->
157 <xsl:apply-templates select="directivesynopsis">
158 <xsl:sort select="name" />
159 </xsl:apply-templates>
161 </xsl:template>
162 <!-- /modulesynopsis -->
165 <!-- ==================================================================== -->
166 <!-- Directivesynopsis -->
167 <!-- ==================================================================== -->
168 <xsl:template match="directivesynopsis/name" mode="simple" name="simpledirname">
169 <xsl:if test="@type='section'"><xsl:text>\textless{}</xsl:text></xsl:if>
170 <xsl:apply-templates/>
171 <xsl:if test="@type='section'"><xsl:text>\textgreater{}</xsl:text></xsl:if>
172 </xsl:template>
174 <xsl:template match="directivesynopsis/name">
175 <xsl:text>\subsection*{</xsl:text>
176 <xsl:call-template name="simpledirname"/>
177 <xsl:choose>
178 <xsl:when test="$message[@id='directive']/@replace-space-with">
179 <xsl:value-of select="$message[@id='directive']/@replace-space-with"/>
180 </xsl:when>
181 <xsl:otherwise>
182 <xsl:text> </xsl:text>
183 </xsl:otherwise>
184 </xsl:choose>
186 <xsl:value-of select="$message[@id='directive']" />
187 <xsl:text>}\label{</xsl:text>
188 <xsl:value-of select="concat('/mod/', //modulesynopsis/name, ':', translate(., $uppercase, $lowercase))"/>
189 <xsl:text>}\hypertarget{</xsl:text>
190 <xsl:value-of select="concat('/mod/', //modulesynopsis/name, ':', translate(., $uppercase, $lowercase))"/>
191 <xsl:text>}{}</xsl:text>
193 </xsl:template>
195 <xsl:template match="directivesynopsis">
196 <xsl:if test="not(@location)">
197 <xsl:apply-templates select="name"/>
198 <!-- Directive header -->
199 <xsl:text>
200 \begin{tabular}{lp{.8\linewidth}}
201 \hline
202 </xsl:text>
203 <xsl:value-of select="$message[@id='description']" />
204 <xsl:text>: &amp; </xsl:text>
205 <xsl:apply-templates select="description" />
206 <xsl:text>\\
207 </xsl:text>
209 <xsl:value-of select="$message[@id='syntax']" />
210 <xsl:text>: &amp; {\ttfamily </xsl:text>
211 <xsl:apply-templates select="syntax" />
212 <xsl:text>}\\
213 </xsl:text>
215 <xsl:if test="default">
216 <xsl:value-of select="$message[@id='default']" />
217 <xsl:text>: &amp; {\ttfamily </xsl:text>
218 <xsl:apply-templates select="default" />
219 <xsl:text>} \\
220 </xsl:text>
221 </xsl:if>
223 <xsl:value-of select="$message[@id='context']" />
224 <xsl:text>: &amp;</xsl:text>
225 <xsl:apply-templates select="contextlist" />
226 <xsl:text> \\
227 </xsl:text>
229 <xsl:if test="override">
230 <xsl:value-of select="$message[@id='override']"/>
231 <xsl:text>: &amp;</xsl:text>
232 <xsl:apply-templates select="override" />
233 <xsl:text> \\
234 </xsl:text>
235 </xsl:if>
237 <xsl:value-of select="$message[@id='status']" />
238 <xsl:text>: &amp;</xsl:text>
239 <xsl:variable name="status" select="translate(
240 ../status, $uppercase, $lowercase)"/>
241 <xsl:value-of select="$message[@id=$status]"/>
242 <xsl:text> \\
243 </xsl:text>
245 <xsl:value-of select="$message[@id='module']" />
246 <xsl:text>: &amp;</xsl:text>
247 <xsl:choose>
248 <xsl:when test="modulelist">
249 <xsl:apply-templates select="modulelist" />
250 </xsl:when>
251 <xsl:otherwise>
252 <xsl:apply-templates select="../name" />
253 </xsl:otherwise>
254 </xsl:choose>
255 <xsl:text> \\
256 </xsl:text>
258 <xsl:if test="compatibility">
259 <xsl:value-of select="$message[@id='compatibility']" />
260 <xsl:text>: &amp;</xsl:text>
261 <xsl:apply-templates select="compatibility" />
262 <xsl:text> \\
263 </xsl:text>
264 </xsl:if>
266 <xsl:text>\hline
267 \end{tabular}
269 </xsl:text>
271 <xsl:apply-templates select="usage" />
273 <xsl:call-template name="seealso"/>
275 </xsl:if> <!-- /not(@location) -->
276 </xsl:template>
277 <!-- /directivesynopsis -->
280 <!-- ==================================================================== -->
281 <!-- <contextlist> -->
282 <!-- ==================================================================== -->
283 <xsl:template match="contextlist">
284 <xsl:apply-templates select="context" />
285 </xsl:template>
286 <!-- /contextlist -->
289 <!-- ==================================================================== -->
290 <!-- <context> -->
291 <!-- Each entry is separeted with a comma -->
292 <!-- ==================================================================== -->
293 <xsl:template match="context">
294 <xsl:choose>
295 <xsl:when test="normalize-space(.) = 'server config'">
296 <xsl:value-of select="$message[@id='serverconfig']" />
297 </xsl:when>
298 <xsl:when test="normalize-space(.) = 'virtual host'">
299 <xsl:value-of select="$message[@id='virtualhost']" />
300 </xsl:when>
301 <xsl:when test="normalize-space(.) = 'directory'">
302 <xsl:value-of select="$message[@id='directory']" />
303 </xsl:when>
304 <xsl:when test="normalize-space(.) = '.htaccess'">
305 <xsl:value-of select="$message[@id='htaccess']" />
306 </xsl:when>
307 <xsl:otherwise> <!-- error -->
308 <xsl:message terminate="yes">
309 unknown context: <xsl:value-of select="." />
310 </xsl:message>
311 </xsl:otherwise>
312 </xsl:choose>
314 <xsl:if test="position() != last()">
315 <xsl:text>, </xsl:text>
316 </xsl:if>
317 </xsl:template>
318 <!-- /context -->
321 <!-- ==================================================================== -->
322 <!-- <modulelist> -->
323 <!-- ==================================================================== -->
324 <xsl:template match="modulelist">
325 <xsl:for-each select="module">
326 <xsl:call-template name="module" />
327 <xsl:if test="position() != last()">
328 <xsl:text>, </xsl:text>
329 </xsl:if>
330 </xsl:for-each>
331 </xsl:template>
332 <!-- /modulelist -->
335 <!-- ==================================================================== -->
336 <!-- modulesynopsis/compatibility -->
337 <!-- ==================================================================== -->
338 <xsl:template match="modulesynopsis/compatibility">
339 <xsl:apply-templates />
340 </xsl:template>
343 <!-- ==================================================================== -->
344 <!-- directivesynopsis/compatibility -->
345 <!-- ==================================================================== -->
346 <xsl:template match="directivesynopsis/compatibility">
347 <xsl:apply-templates />
348 </xsl:template>
350 </xsl:stylesheet>