1 <?xml version=
"1.0" encoding=
"iso-8859-1" ?>
4 ;;; Copyright (c) 2008, Hans Hübner. All rights reserved.
6 ;;; Redistribution and use in source and binary forms, with or without
7 ;;; modification, are permitted provided that the following conditions
10 ;;; * Redistributions of source code must retain the above copyright
11 ;;; notice, this list of conditions and the following disclaimer.
13 ;;; * Redistributions in binary form must reproduce the above
14 ;;; copyright notice, this list of conditions and the following
15 ;;; disclaimer in the documentation and/or other materials
16 ;;; provided with the distribution.
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
34 xmlns:
clix=
"http://bknr.net/clixdoc"
35 exclude-result-prefixes=
"clix">
37 <xsl:output method=
"html"
39 omit-xml-declaration=
"yes"
40 doctype-public=
"-//W3C//DTD HTML 4.0 Strict//EN" />
42 <xsl:key name=
"index-entries" match=
"clix:*[@name and (name() != 'clix:chapter') and (name() != 'clix:subchapter')]" use=
"@name" />
44 <xsl:template match=
"/clix:documentation">
45 <html xmlns=
"http://www.w3.org/1999/xhtml">
47 <meta http-equiv=
"Content-Type" content=
"text/html; charset=iso-8859-1" />
48 <title><xsl:value-of select=
"clix:title"/></title>
49 <meta name=
"description"><xsl:attribute name=
"content"><xsl:value-of select=
"clix:short-description"/></xsl:attribute></meta>
50 <style type=
"text/css">
51 body { background-color: #ffffff }
52 pre { padding:
5px; background-color:#e0e0e0 }
53 pre.none { padding:
5px; background-color:#ffffff }
54 h3, h4, h5 { text-decoration: underline; }
55 .entry-type { padding-left:
1em; font-size:
60%; font-style: italic }
56 a { text-decoration: none; padding:
1px
2px
1px
2px; }
57 a:visited { text-decoration: none; padding:
1px
2px
1px
2px; }
58 a:hover { text-decoration: none; padding:
1px
1px
1px
1px; border:
1px solid #
000000; }
59 a:focus { text-decoration: none; padding:
1px
2px
1px
2px; border: none; }
60 a.none { text-decoration: none; padding:
0; }
61 a.none:visited { text-decoration: none; padding:
0; }
62 a.none:hover { text-decoration: none; border: none; padding:
0; }
63 a.none:focus { text-decoration: none; border: none; padding:
0; }
64 a.noborder { text-decoration: none; padding:
0; }
65 a.noborder:visited { text-decoration: none; padding:
0; }
66 a.noborder:hover { text-decoration: none; border: none; padding:
0; }
67 a.noborder:focus { text-decoration: none; border: none; padding:
0; }
71 <xsl:apply-templates/>
76 <xsl:template match=
"clix:library-version">
77 <xsl:value-of select=
"$library-version"/>
80 <xsl:template match=
"clix:title"/>
81 <xsl:template match=
"clix:short-description"/>
83 <xsl:template match=
"clix:function">
85 <xsl:call-template name=
"make-anchor"/>
87 <xsl:when test=
"clix:special-definition">
88 <xsl:apply-templates select=
"clix:special-definition"/>
91 [
<xsl:call-template name=
"nice-entry-type-name"/>]
93 <xsl:call-template name=
"render-title"/>
94 <xsl:value-of select=
"' '"/>
95 <i><xsl:apply-templates select=
"clix:lambda-list"/></i>
96 <xsl:if test=
"clix:returns">
98 <i><xsl:apply-templates select=
"clix:returns"/></i>
103 <xsl:apply-templates select=
"clix:description"/>
108 <xsl:template match=
"clix:reader">
110 <xsl:call-template name=
"make-anchor"/>
111 [
<xsl:call-template name=
"nice-entry-type-name"/>]
113 <xsl:call-template name=
"render-title"/>
114 <xsl:value-of select=
"' '"/>
115 <i><xsl:apply-templates select=
"clix:lambda-list"/></i>
116 <xsl:if test=
"clix:returns">
118 <i><xsl:apply-templates select=
"clix:returns"/></i>
121 <xsl:apply-templates select=
"clix:description"/>
126 <xsl:template match=
"clix:listed-reader">
127 <xsl:call-template name=
"make-anchor"/>
128 <xsl:call-template name=
"render-title"/>
129 <xsl:value-of select=
"' '"/>
130 <i><xsl:apply-templates select=
"clix:lambda-list"/></i>
131 <xsl:if test=
"clix:returns">
133 <i><xsl:apply-templates select=
"clix:returns"/></i>
138 <xsl:template match=
"clix:writer">
140 <xsl:call-template name=
"make-anchor"/>
141 [
<xsl:call-template name=
"nice-entry-type-name"/>]
143 <tt>(setf (
</tt><b><xsl:value-of select=
"@name"/></b>
144 <xsl:value-of select=
"' '"/>
145 <i><xsl:apply-templates select=
"clix:lambda-list"/></i><tt>)
<i>new-value
</i>)
</tt>
146 <xsl:if test=
"clix:returns">
148 <i><xsl:apply-templates select=
"clix:returns"/></i>
151 <xsl:apply-templates select=
"clix:description"/>
156 <xsl:template match=
"clix:accessor">
158 <xsl:call-template name=
"make-anchor"/>
159 [
<xsl:call-template name=
"nice-entry-type-name"/>]
161 <xsl:call-template name=
"render-title"/>
162 <xsl:value-of select=
"' '"/>
163 <i><xsl:apply-templates select=
"clix:lambda-list"/></i>
165 <i><xsl:apply-templates select=
"clix:returns"/></i>
167 <tt>(setf (
</tt><b><xsl:value-of select=
"@name"/></b>
168 <xsl:value-of select=
"' '"/>
169 <i><xsl:apply-templates select=
"clix:lambda-list"/></i><tt>)
<i>new-value
</i>)
</tt>
171 <xsl:apply-templates select=
"clix:description"/>
176 <xsl:template match=
"clix:listed-accessor">
177 <xsl:call-template name=
"make-anchor"/>
178 <xsl:call-template name=
"render-title"/>
179 <xsl:value-of select=
"' '"/>
180 <i><xsl:apply-templates select=
"clix:lambda-list"/></i>
182 <i><xsl:apply-templates select=
"clix:returns"/></i>
184 <tt>(setf (
</tt><b><xsl:value-of select=
"@name"/></b>
185 <xsl:value-of select=
"' '"/>
186 <i><xsl:apply-templates select=
"clix:lambda-list"/></i><tt>)
<i>new-value
</i>)
</tt>
190 <xsl:template match=
"clix:special-variable | clix:class | clix:condition | clix:symbol | clix:constant">
192 <xsl:call-template name=
"make-anchor"/>
193 [
<xsl:call-template name=
"nice-entry-type-name"/>]
195 <xsl:call-template name=
"render-title"/>
197 <xsl:apply-templates select=
"clix:description"/>
202 <xsl:template match=
"clix:listed-constant">
203 <xsl:call-template name=
"render-title"/>
207 <xsl:template match=
"clix:constants">
208 <!-- Display a list of constants with a common description -->
211 <xsl:apply-templates select=
"clix:listed-constant"/>
213 <xsl:apply-templates select=
"clix:description"/>
218 <xsl:template match=
"clix:readers">
219 <!-- Display a list of readers with a common description -->
221 [
<xsl:call-template name=
"nice-entry-type-name"/>]
<br/>
222 <xsl:apply-templates select=
"clix:listed-reader"/>
224 <xsl:apply-templates select=
"clix:description"/>
229 <xsl:template match=
"clix:accessors">
230 <!-- Display a list of accessors with a common description -->
232 [
<xsl:call-template name=
"nice-entry-type-name"/>]
<br/>
233 <xsl:apply-templates select=
"clix:listed-accessor"/>
235 <xsl:apply-templates select=
"clix:description"/>
240 <xsl:template match=
"clix:qualifier">
241 <!-- method qualifier -->
242 <tt><xsl:value-of select=
"text()"/></tt>
245 <xsl:template match=
"clix:lkw">
246 <!-- lambda list keyword -->
247 <tt>&<xsl:value-of select=
"text()"/></tt>
250 <xsl:template match=
"clix:arg">
251 <!-- argument reference -->
252 <code><i><xsl:value-of select=
"text()"/></i></code>
255 <xsl:template match=
"clix:ref">
256 <xsl:call-template name=
"internal-reference">
257 <xsl:with-param name=
"name"><xsl:value-of select=
"."/></xsl:with-param>
261 <xsl:template match=
"clix:chapter">
264 <xsl:attribute name=
"name"><xsl:value-of select=
"@name"/></xsl:attribute>
265 <xsl:value-of select=
"@title"/>
268 <xsl:apply-templates/>
271 <xsl:template match=
"clix:subchapter">
274 <xsl:attribute name=
"name"><xsl:value-of select=
"@name"/></xsl:attribute>
275 <xsl:value-of select=
"@title"/>
278 <xsl:apply-templates/>
281 <xsl:template match=
"clix:contents">
283 <xsl:for-each select=
"//clix:chapter">
286 <xsl:attribute name=
"href">#
<xsl:value-of select=
"@name"/></xsl:attribute>
287 <xsl:value-of select=
"@title"/>
289 <xsl:if test=
"clix:subchapter">
291 <xsl:for-each select=
"clix:subchapter">
294 <xsl:attribute name=
"href">#
<xsl:value-of select=
"@name"/></xsl:attribute>
295 <xsl:value-of select=
"@title"/>
306 <xsl:template match=
"clix:index">
308 <xsl:for-each select=
"//clix:*[generate-id(.) = generate-id(key('index-entries', @name)[1])]">
309 <xsl:sort select=
"@name"/>
312 <xsl:when test=
"count(key('index-entries', @name)) = 1">
313 <xsl:call-template name=
"internal-reference">
314 <xsl:with-param name=
"name"><xsl:value-of select=
"@name"/></xsl:with-param>
316 <span class=
"entry-type"><xsl:call-template name=
"nice-entry-type-name"/></span>
320 <xsl:attribute name=
"name">
321 <xsl:value-of select=
"@name"/>
324 <xsl:value-of select=
"@name"/>
326 <xsl:for-each select=
"key('index-entries', @name)">
327 <xsl:sort select=
"name()"/>
329 <xsl:call-template name=
"internal-reference">
330 <xsl:with-param name=
"name"><xsl:call-template name=
"make-anchor-name"/></xsl:with-param>
331 <xsl:with-param name=
"title"><xsl:value-of select=
"@name"/></xsl:with-param>
333 <span class=
"entry-type"><xsl:call-template name=
"nice-entry-type-name"/></span>
344 <xsl:template match=
"*">
346 <xsl:copy-of select=
"@*[not(namespace-uri())]"/>
347 <xsl:apply-templates/>
351 <xsl:template name=
"internal-reference">
352 <!-- internal reference -->
353 <xsl:param name=
"name"/>
354 <xsl:param name=
"title"/>
357 <xsl:attribute name=
"href">
358 #
<xsl:value-of select=
"translate($name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>
361 <xsl:when test=
"$title != ''">
362 <xsl:value-of select=
"$title"/>
365 <xsl:value-of select=
"$name"/>
372 <xsl:template name=
"make-anchor-name">
374 <xsl:when test=
"count(key('index-entries', @name)) = 1">
375 <xsl:value-of select=
"translate(@name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>
378 <xsl:value-of select=
"translate(@name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>-
<xsl:value-of select=
"substring(name(), 6)"/>
383 <xsl:template name=
"make-anchor">
385 <xsl:attribute name=
"name">
386 <xsl:call-template name=
"make-anchor-name"/>
391 <xsl:template name=
"render-title">
392 <b><xsl:value-of select=
"@name"/></b>
395 <xsl:template name=
"nice-entry-type-name">
397 <xsl:when test=
"name() = 'clix:function'">
399 <xsl:when test=
"@generic = 'true'">Generic function
</xsl:when>
400 <xsl:when test=
"@specialized = 'true'">Method
</xsl:when>
401 <xsl:when test=
"@macro = 'true'">Macro
</xsl:when>
402 <xsl:otherwise>Function
</xsl:otherwise>
405 <xsl:when test=
"name() = 'clix:reader'">
407 <xsl:when test=
"@generic = 'true'">Generic reader
</xsl:when>
408 <xsl:when test=
"@specialized = 'true'">Specialized reader
</xsl:when>
409 <xsl:otherwise>Reader
</xsl:otherwise>
412 <xsl:when test=
"name() = 'clix:listed-reader'">
414 <xsl:when test=
"@generic = 'true'">Generic reader
</xsl:when>
415 <xsl:when test=
"@specialized = 'true'">Specialized reader
</xsl:when>
416 <xsl:otherwise>Reader
</xsl:otherwise>
419 <xsl:when test=
"name() = 'clix:readers'">
421 <xsl:when test=
"@generic = 'true'">Generic readers
</xsl:when>
422 <xsl:when test=
"@specialized = 'true'">Specialized readers
</xsl:when>
423 <xsl:otherwise>Readers
</xsl:otherwise>
426 <xsl:when test=
"name() = 'clix:accessors'">
428 <xsl:when test=
"@generic = 'true'">Generic accessors
</xsl:when>
429 <xsl:when test=
"@specialized = 'true'">Specialized accessors
</xsl:when>
430 <xsl:otherwise>Accessors
</xsl:otherwise>
433 <xsl:when test=
"name() = 'clix:writer'">
435 <xsl:when test=
"@generic = 'true'">Generic writer
</xsl:when>
436 <xsl:when test=
"@specialized = 'true'">Specialized writer
</xsl:when>
437 <xsl:otherwise>Writer
</xsl:otherwise>
440 <xsl:when test=
"name() = 'clix:listed-accessor'">
442 <xsl:when test=
"@generic = 'true'">Generic accessor
</xsl:when>
443 <xsl:when test=
"@specialized = 'true'">Specialized accessor
</xsl:when>
444 <xsl:otherwise>Accessor
</xsl:otherwise>
447 <xsl:when test=
"name() = 'clix:accessor'">
449 <xsl:when test=
"@generic = 'true'">Generic accessor
</xsl:when>
450 <xsl:when test=
"@specialized = 'true'">Specialized accessor
</xsl:when>
451 <xsl:otherwise>Accessor
</xsl:otherwise>
454 <xsl:when test=
"name() = 'clix:special-variable'">Special variable
</xsl:when>
455 <xsl:when test=
"name() = 'clix:class'">Standard class
</xsl:when>
456 <xsl:when test=
"name() = 'clix:condition'">Condition type
</xsl:when>
457 <xsl:when test=
"name() = 'clix:symbol'">Symbol
</xsl:when>
458 <xsl:when test=
"name() = 'clix:constant'">Constant
</xsl:when>
459 <xsl:when test=
"name() = 'clix:listed-constant'">Constant
</xsl:when>
461 <xsl:value-of select=
"name()" />