2 This this the main stylesheet.
3 Input must have been cleaned up using cleanup.xsl already.
5 This stylesheet does nearly all of the formatting work, but still keeps
6 all data together in one big XML document.
8 A <page> element is produced for each package and symbol.
10 The contents of each <page> will be mostly HTML, with the exception
11 of a few formatting elements like <columns> that are replaced later.
14 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform" version=
"1.0">
15 <xsl:output method=
"xml" indent=
"yes"/>
17 <xsl:template match=
"/">
19 <xsl:apply-templates select=
"documentation"/>
20 <xsl:apply-templates select=
"documentation/package"/>
21 <xsl:apply-templates select=
"documentation/package/symbols"/>
25 <xsl:template match=
"symbols">
26 <xsl:apply-templates/>
31 page generation templates
34 <xsl:template match=
"documentation">
35 <main-page title=
"@title">
38 <xsl:for-each select=
"package">
40 <a href=
"pages/{@id}.html">
42 <xsl:value-of select=
"@name"/>
45 <div style=
"left: 100px">
46 <xsl:apply-templates select=
"documentation-string"/>
52 <xsl:template match=
"package">
54 pathname=
"pages/{@id}.html"
55 title=
"Package {@name}">
58 <a href=
"../index.html">
59 <xsl:value-of select=
"/documentation/@title"/>
64 <xsl:value-of select=
"@name"/>
66 <xsl:apply-templates select=
"documentation-string"/>
69 <xsl:if test=
"sections">
70 <div style=
"margin-left: -30px">
71 <h3>About This Package
</h3>
73 <xsl:apply-templates select=
"sections/section" mode=
"toc"/>
75 <xsl:apply-templates select=
"sections"/>
79 <h3><a name=
"index"></a>Symbol Index
</h3>
80 <xsl:apply-templates select=
"symbols" mode=
"symbol-index"/>
86 <xsl:template match=
"class">
88 pathname=
"pages/{@id}.html"
89 title=
"Class {@name}">
92 <a href=
"{../../@id}.html">
93 <xsl:value-of select=
"../../@name"/>
97 Class
<xsl:value-of select=
"@name"/>
100 <xsl:when test=
"see-also">
101 <columns width=
"100%">
103 <xsl:call-template name=
"class-left"/>
109 <xsl:call-template name=
"main-right"/>
114 <xsl:call-template name=
"class-left"/>
120 <xsl:template match=
"function">
122 pathname=
"pages/{@id}.html"
123 title=
"Function {@name}">
126 <a href=
"{../../@id}.html">
127 <xsl:value-of select=
"../../@name"/>
132 <xsl:value-of select=
"@name"/>
135 <xsl:when test=
"see-also">
138 <xsl:call-template name=
"function-left"/>
144 <xsl:call-template name=
"main-right"/>
149 <xsl:call-template name=
"function-left"/>
155 <xsl:template match=
"macro">
157 pathname=
"pages/{@id}.html"
158 title=
"Macro {@name}">
161 <a href=
"{../../@id}.html">
162 <xsl:value-of select=
"../../@name"/>
167 <xsl:value-of select=
"@name"/>
169 <xsl:apply-templates select=
"lambda-list"/>
170 <xsl:call-template name=
"main"/>
174 <xsl:template match=
"variable">
176 pathname=
"pages/{@id}.html"
177 title=
"Variable {@name}">
180 <a href=
"{../../@id}.html">
181 <xsl:value-of select=
"../../@name"/>
186 <xsl:value-of select=
"@name"/>
188 <xsl:call-template name=
"main"/>
196 <xsl:template match=
"class" mode=
"symbol-index">
197 <a href=
"{@id}.html">
198 <tt><xsl:value-of select=
"@name"/></tt>
200 <xsl:text>, class
</xsl:text>
201 <xsl:call-template name=
"undocumented"/>
205 <xsl:template match=
"function" mode=
"symbol-index">
206 <a href=
"{@id}.html">
207 <tt><xsl:value-of select=
"@name"/></tt>
209 <xsl:text>, function
</xsl:text>
210 <xsl:call-template name=
"undocumented"/>
214 <xsl:template match=
"macro" mode=
"symbol-index">
215 <a href=
"{@id}.html">
216 <tt><xsl:value-of select=
"@name"/></tt>
218 <xsl:text>, macro
</xsl:text>
219 <xsl:call-template name=
"undocumented"/>
223 <xsl:template match=
"variable" mode=
"symbol-index">
224 <a href=
"{@id}.html">
225 <tt><xsl:value-of select=
"@name"/></tt>
227 <xsl:text>, variable
</xsl:text>
228 <xsl:call-template name=
"undocumented"/>
237 <xsl:template match=
"arguments">
241 <xsl:for-each select=
"arg">
244 <xsl:value-of select=
"@arg"/>
246 <xsl:text> --
</xsl:text>
247 <xsl:apply-templates/>
254 <xsl:template name=
"main-left">
255 <xsl:apply-templates select=
"arguments"/>
257 <xsl:when test=
"documentation-string">
258 <h3>Details
<a name=
"details"/></h3>
259 <xsl:apply-templates select=
"documentation-string"/>
262 <p style=
"color: red; font-weight: bold">
263 No documentation string. Possibly unimplemented or incomplete.
267 <xsl:apply-templates select=
"implementation-note"/>
270 <xsl:template name=
"main-right">
271 <xsl:if test=
"see-also/constructor">
275 <xsl:apply-templates select=
"see-also/constructor/see"/>
279 <xsl:if test=
"see-also/slot">
280 <h3>Slot Access Functions
</h3>
283 <xsl:apply-templates select=
"see-also/slot/see"/>
287 <xsl:if test=
"see-also/other">
291 <xsl:apply-templates select=
"see-also/other/see"/>
297 <xsl:template name=
"main">
299 <xsl:when test=
"see-also">
302 <xsl:call-template name=
"main-left"/>
308 <xsl:call-template name=
"main-right"/>
313 <xsl:call-template name=
"main-left"/>
320 <xsl:template match=
"*" mode=
"symbol-index"/>
322 <xsl:template match=
"symbols" mode=
"symbol-index">
323 <xsl:apply-templates mode=
"symbol-index">
324 <xsl:sort select=
"@id" data-type=
"text" order=
"ascending"/>
325 </xsl:apply-templates>
328 <xsl:template name=
"undocumented">
329 <xsl:if test=
"not(documentation-string)">
330 <xsl:text> </xsl:text>
331 <span style=
"color: red">
337 <xsl:template name=
"class-left">
338 <h3>Superclasses
</h3>
340 <xsl:for-each select=
"cpl/superclass">
341 <xsl:call-template name=
"class-list"/>
344 <h3>Documented Subclasses
</h3>
347 <xsl:when test=
"subclasses/subclass">
348 <xsl:for-each select=
"subclasses/subclass">
349 <xsl:sort select=
"@id" data-type=
"text" order=
"ascending"/>
350 <xsl:call-template name=
"class-list"/>
358 <xsl:call-template name=
"main-left"/>
361 <xsl:template name=
"class-list">
362 <xsl:if test=
"position() != 1">
363 <xsl:text>,
</xsl:text>
366 <xsl:when test=
"@id">
367 <a href=
"{@id}.html">
369 <xsl:if test=
"@status = 'INTERNAL'">
370 <xsl:value-of select=
"@package"/>
371 <xsl:text>::
</xsl:text>
373 <xsl:value-of select=
"@name"/>
377 <xsl:when test=
"@status = 'INTERNAL'">
378 <tt style=
"color: #777777">
379 <xsl:value-of select=
"@package"/>
380 <xsl:text>::
</xsl:text>
381 <xsl:value-of select=
"@name"/>
385 <tt style=
"color: #777777">
386 <xsl:value-of select=
"@package"/>
387 <xsl:text>:
</xsl:text>
388 <xsl:value-of select=
"@name"/>
394 <xsl:template name=
"function-left">
397 <xsl:apply-templates select=
"lambda-list"/>
399 <xsl:apply-templates select=
"return"/>
400 <xsl:call-template name=
"main-left"/>
403 <xsl:template match=
"lambda-list">
404 <tt><xsl:value-of select=
"../@name"/></tt>
405 <xsl:text> (
</xsl:text>
406 <xsl:for-each select=
"elt">
407 <xsl:if test=
"position() != 1">
408 <xsl:text> </xsl:text>
410 <b><xsl:value-of select=
"text()"/></b>
412 <xsl:text>)
</xsl:text>
415 <xsl:template mode=
"about-arguments" match=
"lambda-list">
417 <a href=
"{../@id}.html">
419 <xsl:value-of select=
"../@name"/>
420 <xsl:text> (
</xsl:text>
421 <xsl:for-each select=
"elt">
422 <xsl:if test=
"position() != 1">
423 <xsl:text> </xsl:text>
425 <xsl:value-of select=
"text()"/>
427 <xsl:text>)
</xsl:text>
432 <xsl:template match=
"documentation-string">
434 <xsl:apply-templates/>
438 <xsl:template match=
"short">
439 <xsl:apply-templates/>
442 <xsl:template match=
"em">
444 <xsl:apply-templates/>
448 <xsl:template match=
"var">
450 <xsl:apply-templates/>
454 <xsl:template match=
"code">
456 <xsl:apply-templates/>
460 <xsl:template match=
"fun[@fun]">
461 <a href=
"{@id}.html">
463 <xsl:apply-templates/>
468 <xsl:template match=
"a">
470 <xsl:apply-templates/>
474 <xsl:template match=
"class[@class]">
475 <a href=
"{@id}.html">
477 <xsl:apply-templates/>
482 <xsl:template match=
"variable[@variable]">
483 <a href=
"{@id}.html">
485 <xsl:apply-templates/>
490 <xsl:template match=
"itemize">
492 <xsl:apply-templates/>
496 <xsl:template match=
"item">
498 <xsl:apply-templates/>
502 <xsl:template match=
"see">
505 <a href=
"{@id}.html">
507 <xsl:apply-templates/>
513     
515 <xsl:value-of select=
"@see"/>
522 <xsl:template match=
"return">
525 <xsl:apply-templates/>
529 <xsl:template match=
"implementation-note">
530 <h3>Implementation notes
</h3>
531 <xsl:apply-templates/>
534 <xsl:template match=
"break">
538 <xsl:template match=
"sections">
539 <xsl:for-each select=
"section">
541 <a name=
"{generate-id()}"/>
542 <xsl:value-of select=
"@section"/>
544 <xsl:apply-templates/>
548 <xsl:template match=
"section" mode=
"toc">
549 <a href=
"#{generate-id()}" style=
"font-weight: bold">
550 <xsl:value-of select=
"@section"/>
555 <xsl:template match=
"aboutfun">
556 <xsl:variable name=
"fun" select=
"text()"/>
557 <xsl:apply-templates mode=
"about-arguments"
558 select=
"//function[@name=$fun]/lambda-list"/>
559 <div style=
"margin-left: 3em">
561 <xsl:when test=
"//function[@name=$fun]/documentation-string//short">
562 <xsl:for-each select=
"//function[@name=$fun]">
563 <xsl:apply-templates select=
"documentation-string//short"/>
564 <xsl:text> </xsl:text>
565 <a href=
"{@id}.html#details">...
</a>
570 select=
"//function[@name=$fun]/documentation-string"/>
577 <xsl:template match=
"aboutclass">
578 <xsl:variable name=
"name" select=
"text()"/>
579 <xsl:for-each select=
"//class[@name=$name]">
581 <a href=
"{@id}.html">
583 <xsl:value-of select=
"@name"/>
587 <div style=
"margin-left: 3em">
589 <xsl:when test=
"//class[@name=$name]/documentation-string//short">
590 <xsl:for-each select=
"//class[@name=$name]">
591 <xsl:apply-templates select=
"documentation-string//short"/>
592 <xsl:text> </xsl:text>
593 <a href=
"{@id}.html#details">...
</a>
598 select=
"//class[@name=$name]/documentation-string"/>