2 This is 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"
15 xmlns:
macro=
"http://lichteblau.com/macro"
17 <xsl:output method=
"xml" indent=
"yes"/>
19 <xsl:template match=
"/">
21 <xsl:call-template name=
"configuration-attributes"/>
22 <xsl:apply-templates select=
"documentation"/>
23 <xsl:apply-templates select=
"documentation/package"/>
24 <xsl:apply-templates select=
"documentation/package/symbols/*"/>
28 <xsl:template name=
"configuration-attributes">
29 <macro:copy-attribute name=
"logo" path=
"documentation"/>
30 <macro:copy-attribute name=
"css" path=
"documentation"/>
31 <macro:copy-attribute name=
"heading" path=
"documentation"/>
36 page generation templates
39 <xsl:template match=
"documentation">
40 <main-page title=
"{@index-title}">
48 <xsl:for-each select=
"package">
49 <xsl:variable name=
"url"
50 select=
"concat('pages/', @id, '.html')"/>
54 <xsl:value-of select=
"@name"/>
57 <div style=
"left: 100px">
58 <xsl:apply-templates select=
"documentation-string"/>
60 <xsl:if test=
"sections">
61 <p><i>About this package:
</i></p>
63 <xsl:for-each select=
"sections/section">
65 <a href=
"{$url}#{generate-id()}">
66 <xsl:value-of select=
"@section"/>
78 <h3><a name=
"index"></a>Symbol Index
</h3>
80 <xsl:apply-templates select=
"package/symbols/*"
82 <xsl:sort select=
"@name" data-type=
"text" order=
"ascending"/>
83 <xsl:with-param name=
"packagep" select=
"'pages/'"/>
84 </xsl:apply-templates>
91 <xsl:template match=
"package">
93 pathname=
"pages/{@id}.html"
94 title=
"Package {@name}">
98 <a href=
"../index.html">
99 <xsl:value-of select=
"/documentation/@index-title"/>
104 <xsl:value-of select=
"@name"/>
106 <xsl:apply-templates select=
"documentation-string"/>
111 <xsl:if test=
"sections">
112 <div style=
"margin-left: -30px">
113 <h3>About This Package
</h3>
115 <xsl:for-each select=
"sections/section">
116 <a href=
"#{generate-id()}" style=
"font-weight: bold">
117 <xsl:value-of select=
"@section"/>
122 <xsl:apply-templates select=
"sections"/>
127 <h3><a name=
"index"></a>Symbol Index
</h3>
128 <xsl:apply-templates select=
"symbols" mode=
"symbol-index"/>
134 <xsl:template match=
"class-definition">
136 pathname=
"pages/{@id}.html"
137 title=
"Class {@name}">
141 <a href=
"{../../@id}.html">
142 <xsl:value-of select=
"../../@name"/>
146 Class
<xsl:value-of select=
"@name"/>
151 or //class-definition[@id=current()//superclass/@id]
154 <h3>Superclasses
</h3>
156 <xsl:for-each select=
"cpl/superclass">
157 <xsl:call-template name=
"class-list"/>
160 <h3>Documented Subclasses
</h3>
163 <xsl:when test=
"subclasses/subclass">
164 <xsl:for-each select=
"subclasses/subclass">
165 <xsl:sort select=
"@id" data-type=
"text" order=
"ascending"/>
166 <xsl:call-template name=
"class-list"/>
174 <xsl:call-template name=
"main-left"/>
176 </macro:maybe-columns>
180 <xsl:template match=
"function-definition">
182 pathname=
"pages/{@id}.html"
183 title=
"Function {@name}">
187 <a href=
"{../../@id}.html">
188 <xsl:value-of select=
"../../@name"/>
193 <xsl:value-of select=
"@name"/>
196 <macro:maybe-columns test=
"see-also">
200 <xsl:apply-templates select=
"lambda-list"/>
202 <xsl:apply-templates select=
"arguments"/>
203 <xsl:apply-templates select=
"return"/>
204 <xsl:call-template name=
"main-left"/>
206 </macro:maybe-columns>
210 <xsl:template match=
"macro-definition">
212 pathname=
"pages/{@id}.html"
213 title=
"Macro {@name}">
217 <a href=
"{../../@id}.html">
218 <xsl:value-of select=
"../../@name"/>
223 <xsl:value-of select=
"@name"/>
225 <xsl:apply-templates select=
"lambda-list"/>
226 <xsl:call-template name=
"main"/>
231 <xsl:template match=
"variable-definition">
233 pathname=
"pages/{@id}.html"
234 title=
"Variable {@name}">
238 <a href=
"{../../@id}.html">
239 <xsl:value-of select=
"../../@name"/>
244 <xsl:value-of select=
"@name"/>
246 <xsl:call-template name=
"main"/>
255 <xsl:template match=
"*" mode=
"symbol-index"/>
257 <xsl:template match=
"symbols" mode=
"symbol-index">
258 <xsl:param name=
"packagep"/>
260 <xsl:apply-templates mode=
"symbol-index">
261 <xsl:sort select=
"@id" data-type=
"text" order=
"ascending"/>
262 <xsl:with-param name=
"packagep" select=
"$packagep"/>
263 </xsl:apply-templates>
267 <xsl:template name=
"index-entry">
268 <xsl:param name=
"packagep"/>
269 <xsl:param name=
"kind"/>
272 <xsl:if test=
"$packagep">
274 <span class=
"nonlink">
276 <span style=
"color: #777777">
277 <xsl:value-of select=
"../../@name"/>
278 <xsl:text>:
</xsl:text>
285 <a href=
"{$packagep}{@id}.html">
287 <xsl:value-of select=
"@name"/>
290 <xsl:text>,
</xsl:text>
291 <xsl:value-of select=
"$kind"/>
292 <xsl:call-template name=
"undocumented"/>
297 <xsl:template match=
"class-definition" mode=
"symbol-index">
298 <xsl:param name=
"packagep"/>
299 <xsl:call-template name=
"index-entry">
300 <xsl:with-param name=
"packagep" select=
"$packagep"/>
301 <xsl:with-param name=
"kind" select=
"'class'"/>
305 <xsl:template match=
"function-definition" mode=
"symbol-index">
306 <xsl:param name=
"packagep"/>
307 <xsl:call-template name=
"index-entry">
308 <xsl:with-param name=
"packagep" select=
"$packagep"/>
309 <xsl:with-param name=
"kind" select=
"'function'"/>
313 <xsl:template match=
"macro-definition" mode=
"symbol-index">
314 <xsl:param name=
"packagep"/>
315 <xsl:call-template name=
"index-entry">
316 <xsl:with-param name=
"packagep" select=
"$packagep"/>
317 <xsl:with-param name=
"kind" select=
"'macro'"/>
321 <xsl:template match=
"variable-definition" mode=
"symbol-index">
322 <xsl:param name=
"packagep"/>
323 <xsl:call-template name=
"index-entry">
324 <xsl:with-param name=
"packagep" select=
"$packagep"/>
325 <xsl:with-param name=
"kind" select=
"'variable'"/>
334 <xsl:template match=
"arguments">
338 <xsl:for-each select=
"arg">
341 <xsl:value-of select=
"@arg"/>
343 <xsl:text> --
</xsl:text>
344 <xsl:apply-templates/>
351 <xsl:template name=
"main-left">
353 <xsl:when test=
"documentation-string">
354 <h3>Details
<a name=
"details"/></h3>
355 <xsl:apply-templates select=
"documentation-string"/>
358 <p style=
"color: red; font-weight: bold">
359 No documentation string. Possibly unimplemented or incomplete.
363 <xsl:apply-templates select=
"implementation-note"/>
366 <xsl:template name=
"main-right">
367 <xsl:if test=
"see-also/constructor">
371 <xsl:apply-templates select=
"see-also/constructor/see"/>
375 <xsl:if test=
"see-also/slot">
376 <h3>Slot Access Functions
</h3>
379 <xsl:apply-templates select=
"see-also/slot/see"/>
384 test=
"//class-definition[@id=current()//superclass/@id]
387 <h3>Inherited Slot Access Functions
</h3>
391 select=
"//class-definition[@id=current()//superclass/@id]
392 //see-also/slot/see"/>
396 <xsl:if test=
"see-also/other|see-also/auto">
400 <xsl:for-each select=
"see-also/other/see|see-also/auto/see">
401 <xsl:variable name=
"name" select=
"text()"/>
402 <xsl:if test=
"not(preceding-sibling::see[text() = $name])">
403 <xsl:apply-templates select=
"."/>
411 <xsl:template name=
"main">
412 <macro:maybe-columns test=
"see-also">
413 <xsl:call-template name=
"main-left"/>
414 </macro:maybe-columns>
417 <xsl:template name=
"class-list">
418 <xsl:if test=
"position() != 1">
419 <xsl:text>,
</xsl:text>
422 <xsl:when test=
"@id">
423 <a href=
"{@id}.html">
425 <xsl:if test=
"@status = 'INTERNAL'">
426 <xsl:value-of select=
"@package"/>
427 <xsl:text>::
</xsl:text>
429 <xsl:value-of select=
"@name"/>
433 <xsl:when test=
"@status = 'INTERNAL'">
434 <tt style=
"color: #777777">
435 <xsl:value-of select=
"@package"/>
436 <xsl:text>::
</xsl:text>
437 <xsl:value-of select=
"@name"/>
441 <tt style=
"color: #777777">
442 <xsl:value-of select=
"@package"/>
443 <xsl:text>:
</xsl:text>
444 <xsl:value-of select=
"@name"/>
450 <xsl:template match=
"lambda-list">
451 <tt><xsl:value-of select=
"../@name"/></tt>
452 <xsl:text> (
</xsl:text>
453 <xsl:for-each select=
"elt">
454 <xsl:if test=
"position() != 1">
455 <xsl:text> </xsl:text>
457 <b><xsl:value-of select=
"text()"/></b>
459 <xsl:text>)
</xsl:text>
462 <xsl:template mode=
"about-arguments" match=
"lambda-list">
464 <a href=
"{../@id}.html">
466 <xsl:value-of select=
"../@name"/>
467 <xsl:text> (
</xsl:text>
468 <xsl:for-each select=
"elt">
469 <xsl:if test=
"position() != 1">
470 <xsl:text> </xsl:text>
472 <xsl:value-of select=
"text()"/>
474 <xsl:text>)
</xsl:text>
479 <xsl:template match=
"documentation-string">
481 <xsl:apply-templates/>
485 <xsl:template match=
"short">
486 <xsl:apply-templates/>
489 <xsl:template match=
"em">
491 <xsl:apply-templates/>
495 <xsl:template match=
"b">
497 <xsl:apply-templates/>
501 <xsl:template match=
"var">
503 <xsl:apply-templates/>
507 <xsl:template match=
"code">
509 <xsl:apply-templates/>
513 <xsl:template match=
"pre">
515 <xsl:apply-templates/>
519 <xsl:template match=
"a">
521 <xsl:apply-templates/>
525 <xsl:template match=
"fun">
526 <a href=
"{@id}.html">
528 <xsl:apply-templates/>
533 <xsl:template match=
"class">
534 <a href=
"{@id}.html">
536 <xsl:apply-templates/>
541 <xsl:template match=
"variable">
542 <a href=
"{@id}.html">
544 <xsl:apply-templates/>
549 <xsl:template match=
"itemize">
551 <xsl:apply-templates/>
555 <xsl:template match=
"item">
557 <xsl:apply-templates/>
561 <xsl:template match=
"see">
564 <a href=
"{@id}.html">
566 <xsl:apply-templates/>
572     
574 <xsl:value-of select=
"@see"/>
581 <xsl:template match=
"return">
582 <h3>Return Value
</h3>
584 <xsl:apply-templates/>
588 <xsl:template match=
"implementation-note">
589 <h3>Implementation notes
</h3>
590 <xsl:apply-templates/>
593 <xsl:template match=
"break">
597 <xsl:template match=
"sections">
598 <xsl:for-each select=
"section">
600 <a name=
"{generate-id()}"/>
601 <xsl:value-of select=
"@section"/>
603 <xsl:apply-templates/>
607 <xsl:template match=
"aboutfun">
608 <xsl:variable name=
"fun" select=
"text()"/>
610 mode=
"about-arguments"
611 select=
"//function-definition[@name=$fun]/lambda-list"/>
612 <div style=
"margin-left: 3em">
615 test=
"//function-definition[@name=$fun]/documentation-string//short">
616 <xsl:for-each select=
"//function-definition[@name=$fun]">
617 <xsl:apply-templates select=
"documentation-string//short"/>
618 <xsl:text> </xsl:text>
619 <a href=
"{@id}.html#details">...
</a>
624 select=
"//function-definition[@name=$fun]/documentation-string"/>
631 <xsl:template match=
"aboutclass">
632 <xsl:variable name=
"name" select=
"text()"/>
633 <xsl:for-each select=
"//class-definition[@name=$name]">
635 <a href=
"{@id}.html">
637 <xsl:value-of select=
"@name"/>
641 <div style=
"margin-left: 3em">
644 test=
"//class-definition[@name=$name]/documentation-string//short">
645 <xsl:for-each select=
"//class-definition[@name=$name]">
646 <xsl:apply-templates select=
"documentation-string//short"/>
647 <xsl:text> </xsl:text>
648 <a href=
"{@id}.html#details">...
</a>
653 select=
"//class-definition[@name=$name]/documentation-string"/>
660 <xsl:template name=
"undocumented">
661 <xsl:if test=
"not(documentation-string)">
662 <xsl:text> </xsl:text>
663 <span style=
"color: red">