]> git.0d.be Git - empathy.git/blob - tools/doc-generator.xsl
Update tools/.gitignore
[empathy.git] / tools / doc-generator.xsl
1 <!-- Generate HTML documentation from the Telepathy specification.
2 The master copy of this stylesheet is in the Telepathy spec repository -
3 please make any changes there.
4
5 Copyright (C) 2006-2008 Collabora Limited
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20 -->
21
22 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
23   xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"
24   xmlns:html="http://www.w3.org/1999/xhtml"
25   exclude-result-prefixes="tp html">
26   <!--Don't move the declaration of the HTML namespace up here - XMLNSs
27   don't work ideally in the presence of two things that want to use the
28   absence of a prefix, sadly. -->
29
30   <xsl:template match="html:*" mode="html">
31     <xsl:copy>
32       <xsl:apply-templates mode="html"/>
33     </xsl:copy>
34   </xsl:template>
35
36   <xsl:template match="*" mode="identity">
37     <xsl:copy>
38       <xsl:apply-templates mode="identity"/>
39     </xsl:copy>
40   </xsl:template>
41
42   <xsl:template match="tp:docstring">
43     <xsl:apply-templates select="text() | html:*" mode="html"/>
44     <xsl:apply-templates select="tp:rationale"/>
45   </xsl:template>
46
47   <xsl:template match="tp:rationale">
48     <div xmlns="http://www.w3.org/1999/xhtml" class="rationale">
49       <xsl:apply-templates select="node()" mode="html"/>
50     </div>
51   </xsl:template>
52
53   <xsl:template match="tp:errors">
54     <h1 xmlns="http://www.w3.org/1999/xhtml">Errors</h1>
55     <xsl:apply-templates/>
56   </xsl:template>
57
58   <xsl:template match="tp:generic-types">
59     <h1 xmlns="http://www.w3.org/1999/xhtml">Generic types</h1>
60     <xsl:call-template name="do-types"/>
61   </xsl:template>
62
63   <xsl:template name="do-types">
64     <xsl:if test="tp:simple-type">
65       <h2 xmlns="http://www.w3.org/1999/xhtml">Simple types</h2>
66       <xsl:apply-templates select="tp:simple-type"/>
67     </xsl:if>
68
69     <xsl:if test="tp:enum">
70       <h2 xmlns="http://www.w3.org/1999/xhtml">Enumerated types:</h2>
71       <xsl:apply-templates select="tp:enum"/>
72     </xsl:if>
73
74     <xsl:if test="tp:flags">
75       <h2 xmlns="http://www.w3.org/1999/xhtml">Sets of flags:</h2>
76       <xsl:apply-templates select="tp:flags"/>
77     </xsl:if>
78
79     <xsl:if test="tp:struct">
80       <h2 xmlns="http://www.w3.org/1999/xhtml">Structure types</h2>
81       <xsl:apply-templates select="tp:struct"/>
82     </xsl:if>
83
84     <xsl:if test="tp:mapping">
85       <h2 xmlns="http://www.w3.org/1999/xhtml">Mapping types</h2>
86       <xsl:apply-templates select="tp:mapping"/>
87     </xsl:if>
88
89     <xsl:if test="tp:external-type">
90       <h2 xmlns="http://www.w3.org/1999/xhtml">Types defined elsewhere</h2>
91       <dl><xsl:apply-templates select="tp:external-type"/></dl>
92     </xsl:if>
93   </xsl:template>
94
95   <xsl:template match="tp:error">
96     <h2 xmlns="http://www.w3.org/1999/xhtml"><a name="{concat(../@namespace, '.', translate(@name, ' ', ''))}"></a><xsl:value-of select="concat(../@namespace, '.', translate(@name, ' ', ''))"/></h2>
97     <xsl:apply-templates select="tp:docstring"/>
98   </xsl:template>
99
100   <xsl:template match="/tp:spec/tp:copyright">
101     <div xmlns="http://www.w3.org/1999/xhtml">
102       <xsl:apply-templates/>
103     </div>
104   </xsl:template>
105   <xsl:template match="/tp:spec/tp:license">
106     <div xmlns="http://www.w3.org/1999/xhtml" class="license">
107       <xsl:apply-templates mode="html"/>
108     </div>
109   </xsl:template>
110
111   <xsl:template match="tp:copyright"/>
112   <xsl:template match="tp:license"/>
113
114   <xsl:template match="interface">
115     <h1 xmlns="http://www.w3.org/1999/xhtml"><a name="{@name}"></a><xsl:value-of select="@name"/></h1>
116
117     <xsl:if test="@tp:causes-havoc">
118       <p xmlns="http://www.w3.org/1999/xhtml" class="causes-havoc">
119         This interface is <xsl:value-of select="@tp:causes-havoc"/>
120         and is likely to cause havoc to your API/ABI if bindings are generated.
121         Don't include it in libraries that care about compatibility.
122       </p>
123     </xsl:if>
124
125     <xsl:if test="tp:requires">
126       <p>Implementations of this interface must also implement:</p>
127       <ul xmlns="http://www.w3.org/1999/xhtml">
128         <xsl:for-each select="tp:requires">
129           <li><code><a href="#{@interface}"><xsl:value-of select="@interface"/></a></code></li>
130         </xsl:for-each>
131       </ul>
132     </xsl:if>
133
134     <xsl:apply-templates select="tp:docstring" />
135
136     <xsl:choose>
137       <xsl:when test="method">
138         <h2 xmlns="http://www.w3.org/1999/xhtml">Methods:</h2>
139         <xsl:apply-templates select="method"/>
140       </xsl:when>
141       <xsl:otherwise>
142         <p xmlns="http://www.w3.org/1999/xhtml">Interface has no methods.</p>
143       </xsl:otherwise>
144     </xsl:choose>
145
146     <xsl:choose>
147       <xsl:when test="signal">
148         <h2 xmlns="http://www.w3.org/1999/xhtml">Signals:</h2>
149         <xsl:apply-templates select="signal"/>
150       </xsl:when>
151       <xsl:otherwise>
152         <p xmlns="http://www.w3.org/1999/xhtml">Interface has no signals.</p>
153       </xsl:otherwise>
154     </xsl:choose>
155
156     <xsl:choose>
157       <xsl:when test="tp:property">
158         <h2 xmlns="http://www.w3.org/1999/xhtml">Telepathy Properties:</h2>
159         <p xmlns="http://www.w3.org/1999/xhtml">Accessed using the
160           <a href="#org.freedesktop.Telepathy.Properties">Telepathy
161             Properties</a> interface.</p>
162         <dl xmlns="http://www.w3.org/1999/xhtml">
163           <xsl:apply-templates select="tp:property"/>
164         </dl>
165       </xsl:when>
166       <xsl:otherwise>
167         <p xmlns="http://www.w3.org/1999/xhtml">Interface has no Telepathy
168           properties.</p>
169       </xsl:otherwise>
170     </xsl:choose>
171
172     <xsl:choose>
173       <xsl:when test="property">
174         <h2 xmlns="http://www.w3.org/1999/xhtml">D-Bus core Properties:</h2>
175         <p xmlns="http://www.w3.org/1999/xhtml">Accessed using the
176           org.freedesktop.DBus.Properties interface.</p>
177         <dl xmlns="http://www.w3.org/1999/xhtml">
178           <xsl:apply-templates select="property"/>
179         </dl>
180       </xsl:when>
181       <xsl:otherwise>
182         <p xmlns="http://www.w3.org/1999/xhtml">Interface has no D-Bus core
183           properties.</p>
184       </xsl:otherwise>
185     </xsl:choose>
186
187     <xsl:call-template name="do-types"/>
188
189   </xsl:template>
190
191   <xsl:template match="tp:flags">
192     <h3>
193       <a name="type-{@name}">
194         <xsl:value-of select="@name"/>
195       </a>
196     </h3>
197     <xsl:apply-templates select="tp:docstring" />
198     <dl xmlns="http://www.w3.org/1999/xhtml">
199         <xsl:variable name="value-prefix">
200           <xsl:choose>
201             <xsl:when test="@value-prefix">
202               <xsl:value-of select="@value-prefix"/>
203             </xsl:when>
204             <xsl:otherwise>
205               <xsl:value-of select="@name"/>
206             </xsl:otherwise>
207           </xsl:choose>
208         </xsl:variable>
209       <xsl:for-each select="tp:flag">
210         <dt xmlns="http://www.w3.org/1999/xhtml"><code><xsl:value-of select="concat($value-prefix, '_', @suffix)"/> = <xsl:value-of select="@value"/></code></dt>
211         <xsl:choose>
212           <xsl:when test="tp:docstring">
213             <dd xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates select="tp:docstring" /></dd>
214           </xsl:when>
215           <xsl:otherwise>
216             <dd xmlns="http://www.w3.org/1999/xhtml">(Undocumented)</dd>
217           </xsl:otherwise>
218         </xsl:choose>
219       </xsl:for-each>
220     </dl>
221   </xsl:template>
222
223   <xsl:template match="tp:enum">
224     <h3 xmlns="http://www.w3.org/1999/xhtml">
225       <a name="type-{@name}">
226         <xsl:value-of select="@name"/>
227       </a>
228     </h3>
229     <xsl:apply-templates select="tp:docstring" />
230     <dl xmlns="http://www.w3.org/1999/xhtml">
231         <xsl:variable name="value-prefix">
232           <xsl:choose>
233             <xsl:when test="@value-prefix">
234               <xsl:value-of select="@value-prefix"/>
235             </xsl:when>
236             <xsl:otherwise>
237               <xsl:value-of select="@name"/>
238             </xsl:otherwise>
239           </xsl:choose>
240         </xsl:variable>
241       <xsl:for-each select="tp:enumvalue">
242         <dt xmlns="http://www.w3.org/1999/xhtml"><code><xsl:value-of select="concat($value-prefix, '_', @suffix)"/> = <xsl:value-of select="@value"/></code></dt>
243         <xsl:choose>
244           <xsl:when test="tp:docstring">
245             <dd xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates select="tp:docstring" /></dd>
246           </xsl:when>
247           <xsl:otherwise>
248             <dd xmlns="http://www.w3.org/1999/xhtml">(Undocumented)</dd>
249           </xsl:otherwise>
250         </xsl:choose>
251       </xsl:for-each>
252     </dl>
253   </xsl:template>
254
255   <xsl:template match="property">
256     <dt xmlns="http://www.w3.org/1999/xhtml">
257       <a name="{concat(../@name, '.', @name)}">
258         <code><xsl:value-of select="@name"/></code>
259       </a>
260       <xsl:text> - </xsl:text>
261       <code><xsl:value-of select="@type"/></code>
262       <xsl:call-template name="parenthesized-tp-type"/>
263       <xsl:text>, </xsl:text>
264       <xsl:choose>
265         <xsl:when test="@access = 'read'">
266           <xsl:text>read-only</xsl:text>
267         </xsl:when>
268         <xsl:when test="@access = 'write'">
269           <xsl:text>write-only</xsl:text>
270         </xsl:when>
271         <xsl:when test="@access = 'readwrite'">
272           <xsl:text>read/write</xsl:text>
273         </xsl:when>
274         <xsl:otherwise>
275           <xsl:text>access: </xsl:text>
276           <code><xsl:value-of select="@access"/></code>
277         </xsl:otherwise>
278       </xsl:choose>
279     </dt>
280     <dd xmlns="http://www.w3.org/1999/xhtml">
281       <xsl:apply-templates select="tp:docstring"/>
282     </dd>
283   </xsl:template>
284
285   <xsl:template match="tp:property">
286     <dt xmlns="http://www.w3.org/1999/xhtml">
287       <xsl:if test="@name">
288         <code><xsl:value-of select="@name"/></code> -
289       </xsl:if>
290       <code><xsl:value-of select="@type"/></code>
291     </dt>
292     <dd xmlns="http://www.w3.org/1999/xhtml">
293       <xsl:apply-templates select="tp:docstring"/>
294     </dd>
295   </xsl:template>
296
297   <xsl:template match="tp:mapping">
298     <div xmlns="http://www.w3.org/1999/xhtml" class="struct">
299       <h3>
300         <a name="type-{@name}">
301           <xsl:value-of select="@name"/>
302         </a> - a{
303         <xsl:for-each select="tp:member">
304           <xsl:value-of select="@type"/>
305           <xsl:text>: </xsl:text>
306           <xsl:value-of select="@name"/>
307           <xsl:if test="position() != last()"> &#x2192; </xsl:if>
308         </xsl:for-each>
309         }
310       </h3>
311       <div class="docstring">
312         <xsl:apply-templates select="tp:docstring"/>
313       </div>
314       <div>
315         <h4>Members</h4>
316         <dl>
317           <xsl:apply-templates select="tp:member" mode="members-in-docstring"/>
318         </dl>
319       </div>
320     </div>
321   </xsl:template>
322
323   <xsl:template match="tp:docstring" mode="in-index"/>
324
325   <xsl:template match="tp:simple-type | tp:enum | tp:flags | tp:external-type"
326     mode="in-index">
327     - <xsl:value-of select="@type"/>
328   </xsl:template>
329
330   <xsl:template match="tp:simple-type">
331     <div xmlns="http://www.w3.org/1999/xhtml" class="simple-type">
332       <h3>
333         <a name="type-{@name}">
334           <xsl:value-of select="@name"/>
335         </a> - <xsl:value-of select="@type"/>
336       </h3>
337       <div class="docstring">
338         <xsl:apply-templates select="tp:docstring"/>
339       </div>
340     </div>
341   </xsl:template>
342
343   <xsl:template match="tp:external-type">
344     <div xmlns="http://www.w3.org/1999/xhtml" class="external-type">
345       <dt>
346         <a name="type-{@name}">
347           <xsl:value-of select="@name"/>
348         </a> - <xsl:value-of select="@type"/>
349       </dt>
350       <dd>Defined by: <xsl:value-of select="@from"/></dd>
351     </div>
352   </xsl:template>
353
354   <xsl:template match="tp:struct" mode="in-index">
355     - ( <xsl:for-each select="tp:member">
356           <xsl:value-of select="@type"/>
357           <xsl:if test="position() != last()">, </xsl:if>
358         </xsl:for-each> )
359   </xsl:template>
360
361   <xsl:template match="tp:mapping" mode="in-index">
362     - a{ <xsl:for-each select="tp:member">
363           <xsl:value-of select="@type"/>
364           <xsl:if test="position() != last()"> &#x2192; </xsl:if>
365         </xsl:for-each> }
366   </xsl:template>
367
368   <xsl:template match="tp:struct">
369     <div xmlns="http://www.w3.org/1999/xhtml" class="struct">
370       <h3>
371         <a name="type-{@name}">
372           <xsl:value-of select="@name"/>
373         </a> - (
374         <xsl:for-each select="tp:member">
375           <xsl:value-of select="@type"/>
376           <xsl:text>: </xsl:text>
377           <xsl:value-of select="@name"/>
378           <xsl:if test="position() != last()">, </xsl:if>
379         </xsl:for-each>
380         )
381       </h3>
382       <div class="docstring">
383         <xsl:apply-templates select="tp:docstring"/>
384       </div>
385       <xsl:choose>
386         <xsl:when test="string(@array-name) != ''">
387           <p>In bindings that need a separate name, arrays of
388             <xsl:value-of select="@name"/> should be called
389             <xsl:value-of select="@array-name"/>.</p>
390         </xsl:when>
391         <xsl:otherwise>
392           <p>Arrays of <xsl:value-of select="@name"/> don't generally
393             make sense.</p>
394         </xsl:otherwise>
395       </xsl:choose>
396       <div>
397         <h4>Members</h4>
398         <dl>
399           <xsl:apply-templates select="tp:member" mode="members-in-docstring"/>
400         </dl>
401       </div>
402     </div>
403   </xsl:template>
404
405   <xsl:template match="method">
406     <div xmlns="http://www.w3.org/1999/xhtml" class="method">
407       <h3 xmlns="http://www.w3.org/1999/xhtml">
408         <a name="{concat(../@name, concat('.', @name))}">
409           <xsl:value-of select="@name"/>
410         </a> (
411         <xsl:for-each xmlns="" select="arg[@direction='in']">
412           <xsl:value-of select="@type"/>: <xsl:value-of select="@name"/>
413           <xsl:if test="position() != last()">, </xsl:if>
414         </xsl:for-each>
415         ) &#x2192;
416         <xsl:choose>
417           <xsl:when test="arg[@direction='out']">
418             <xsl:for-each xmlns="" select="arg[@direction='out']">
419               <xsl:value-of select="@type"/>
420               <xsl:if test="position() != last()">, </xsl:if>
421             </xsl:for-each>
422           </xsl:when>
423           <xsl:otherwise>nothing</xsl:otherwise>
424         </xsl:choose>
425       </h3>
426       <div xmlns="http://www.w3.org/1999/xhtml" class="docstring">
427         <xsl:apply-templates select="tp:docstring" />
428       </div>
429
430       <xsl:if test="arg[@direction='in']">
431         <div xmlns="http://www.w3.org/1999/xhtml">
432           <h4>Parameters</h4>
433           <dl xmlns="http://www.w3.org/1999/xhtml">
434             <xsl:apply-templates select="arg[@direction='in']"
435               mode="parameters-in-docstring"/>
436           </dl>
437         </div>
438       </xsl:if>
439
440       <xsl:if test="arg[@direction='out']">
441         <div xmlns="http://www.w3.org/1999/xhtml">
442           <h4>Returns</h4>
443           <dl xmlns="http://www.w3.org/1999/xhtml">
444             <xsl:apply-templates select="arg[@direction='out']"
445               mode="returns-in-docstring"/>
446           </dl>
447         </div>
448       </xsl:if>
449
450       <xsl:if test="tp:possible-errors">
451         <div xmlns="http://www.w3.org/1999/xhtml">
452           <h4>Possible errors</h4>
453           <dl xmlns="http://www.w3.org/1999/xhtml">
454             <xsl:apply-templates select="tp:possible-errors/tp:error"/>
455           </dl>
456         </div>
457       </xsl:if>
458
459     </div>
460   </xsl:template>
461
462   <xsl:template name="parenthesized-tp-type">
463     <xsl:if test="@tp:type">
464       <xsl:variable name="tp-type" select="@tp:type"/>
465       <xsl:variable name="single-type">
466         <xsl:choose>
467           <xsl:when test="contains($tp-type, '[]')">
468             <xsl:value-of select="substring-before($tp-type, '[]')"/>
469           </xsl:when>
470           <xsl:otherwise>
471             <xsl:value-of select="$tp-type"/>
472           </xsl:otherwise>
473         </xsl:choose>
474       </xsl:variable>
475       <xsl:choose>
476         <xsl:when test="//tp:simple-type[@name=$tp-type]" />
477         <xsl:when test="//tp:simple-type[concat(@name, '[]')=$tp-type]" />
478         <xsl:when test="//tp:struct[concat(@name, '[]')=$tp-type][string(@array-name) != '']" />
479         <xsl:when test="//tp:struct[@name=$tp-type]" />
480         <xsl:when test="//tp:enum[@name=$tp-type]" />
481         <xsl:when test="//tp:enum[concat(@name, '[]')=$tp-type]" />
482         <xsl:when test="//tp:flags[@name=$tp-type]" />
483         <xsl:when test="//tp:flags[concat(@name, '[]')=$tp-type]" />
484         <xsl:when test="//tp:mapping[@name=$tp-type]" />
485         <xsl:when test="//tp:external-type[concat(@name, '[]')=$tp-type]" />
486         <xsl:when test="//tp:external-type[@name=$tp-type]" />
487         <xsl:otherwise>
488           <xsl:message terminate="yes">
489             <xsl:text>ERR: Unable to find type '</xsl:text>
490             <xsl:value-of select="$tp-type"/>
491             <xsl:text>'&#10;</xsl:text>
492           </xsl:message>
493         </xsl:otherwise>
494       </xsl:choose>
495       (<a href="#type-{$single-type}"><xsl:value-of select="$tp-type"/></a>)
496     </xsl:if>
497   </xsl:template>
498
499   <xsl:template match="tp:member" mode="members-in-docstring">
500     <dt xmlns="http://www.w3.org/1999/xhtml">
501       <code><xsl:value-of select="@name"/></code> -
502       <code><xsl:value-of select="@type"/></code>
503       <xsl:call-template name="parenthesized-tp-type"/>
504     </dt>
505     <dd xmlns="http://www.w3.org/1999/xhtml">
506       <xsl:choose>
507         <xsl:when test="tp:docstring">
508           <xsl:apply-templates select="tp:docstring" />
509         </xsl:when>
510         <xsl:otherwise>
511           <em>(undocumented)</em>
512         </xsl:otherwise>
513       </xsl:choose>
514     </dd>
515   </xsl:template>
516
517   <xsl:template match="arg" mode="parameters-in-docstring">
518     <dt xmlns="http://www.w3.org/1999/xhtml">
519       <code><xsl:value-of select="@name"/></code> -
520       <code><xsl:value-of select="@type"/></code>
521       <xsl:call-template name="parenthesized-tp-type"/>
522     </dt>
523     <dd xmlns="http://www.w3.org/1999/xhtml">
524       <xsl:apply-templates select="tp:docstring" />
525     </dd>
526   </xsl:template>
527
528   <xsl:template match="arg" mode="returns-in-docstring">
529     <dt xmlns="http://www.w3.org/1999/xhtml">
530       <xsl:if test="@name">
531         <code><xsl:value-of select="@name"/></code> -
532       </xsl:if>
533       <code><xsl:value-of select="@type"/></code>
534       <xsl:call-template name="parenthesized-tp-type"/>
535     </dt>
536     <dd xmlns="http://www.w3.org/1999/xhtml">
537       <xsl:apply-templates select="tp:docstring"/>
538     </dd>
539   </xsl:template>
540
541   <xsl:template match="tp:possible-errors/tp:error">
542     <dt xmlns="http://www.w3.org/1999/xhtml">
543       <code><xsl:value-of select="@name"/></code>
544     </dt>
545     <dd xmlns="http://www.w3.org/1999/xhtml">
546         <xsl:variable name="name" select="@name"/>
547         <xsl:choose>
548           <xsl:when test="tp:docstring">
549             <xsl:apply-templates select="tp:docstring"/>
550           </xsl:when>
551           <xsl:when test="//tp:errors/tp:error[concat(../@namespace, '.', translate(@name, ' ', ''))=$name]/tp:docstring">
552             <xsl:apply-templates select="//tp:errors/tp:error[concat(../@namespace, '.', translate(@name, ' ', ''))=$name]/tp:docstring"/> <em xmlns="http://www.w3.org/1999/xhtml">(generic description)</em>
553           </xsl:when>
554           <xsl:otherwise>
555             (Undocumented.)
556           </xsl:otherwise>
557         </xsl:choose>
558     </dd>
559   </xsl:template>
560
561   <xsl:template match="signal">
562     <div xmlns="http://www.w3.org/1999/xhtml" class="signal">
563       <h3 xmlns="http://www.w3.org/1999/xhtml">
564         <a name="{concat(../@name, concat('.', @name))}">
565           <xsl:value-of select="@name"/>
566         </a> (
567         <xsl:for-each xmlns="" select="arg">
568           <xsl:value-of select="@type"/>: <xsl:value-of select="@name"/>
569           <xsl:if test="position() != last()">, </xsl:if>
570         </xsl:for-each>
571         )</h3>
572       <div xmlns="http://www.w3.org/1999/xhtml" class="docstring">
573         <xsl:apply-templates select="tp:docstring"/>
574       </div>
575
576       <xsl:if test="arg">
577         <div xmlns="http://www.w3.org/1999/xhtml">
578           <h4>Parameters</h4>
579           <dl xmlns="http://www.w3.org/1999/xhtml">
580             <xsl:apply-templates select="arg" mode="parameters-in-docstring"/>
581           </dl>
582         </div>
583       </xsl:if>
584     </div>
585   </xsl:template>
586
587   <xsl:output method="xml" indent="no" encoding="ascii"
588     omit-xml-declaration="yes"
589     doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
590     doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" />
591
592   <xsl:template match="/tp:spec">
593     <html xmlns="http://www.w3.org/1999/xhtml">
594       <head>
595         <title>
596           <xsl:value-of select="tp:title"/>
597           <xsl:if test="tp:version">
598             <xsl:text> version </xsl:text>
599             <xsl:value-of select="tp:version"/>
600           </xsl:if>
601         </title>
602         <style type="text/css">
603
604           body {
605             font-family: sans-serif;
606             margin: 2em;
607             height: 100%;
608             font-size: 1.2em;
609           }
610           h1 {
611             padding-top: 5px;
612             padding-bottom: 5px;
613             font-size: 1.6em;
614             background: #dadae2;
615           }
616           h2 {
617             font-size: 1.3em;
618           }
619           h3 {
620             font-size: 1.2em;
621           }
622           a:link, a:visited, a:link:hover, a:visited:hover {
623             font-weight: bold;
624           }
625           .topbox {
626             padding-top: 10px;
627             padding-left: 10px;
628             border-bottom: black solid 1px;
629             padding-bottom: 10px;
630             background: #dadae2;
631             font-size: 2em;
632             font-weight: bold;
633             color: #5c5c5c;
634           }
635           .topnavbox {
636             padding-left: 10px;
637             padding-top: 5px;
638             padding-bottom: 5px;
639             background: #abacba;
640             border-bottom: black solid 1px;
641             font-size: 1.2em;
642           }
643           .topnavbox a{
644             color: black;
645             font-weight: normal;
646           }
647           .sidebar {
648             float: left;
649             /* width:9em;
650             border-right:#abacba solid 1px;
651             border-left: #abacba solid 1px;
652             height:100%; */
653             border: #abacba solid 1px;
654             padding-left: 10px;
655             margin-left: 10px;
656             padding-right: 10px;
657             margin-right: 10px;
658             color: #5d5d5d;
659             background: #dadae2;
660           }
661           .sidebar a {
662             text-decoration: none;
663             border-bottom: #e29625 dotted 1px;
664             color: #e29625;
665             font-weight: normal;
666           }
667           .sidebar h1 {
668             font-size: 1.2em;
669             color: black;
670           }
671           .sidebar ul {
672             padding-left: 25px;
673             padding-bottom: 10px;
674             border-bottom: #abacba solid 1px;
675           }
676           .sidebar li {
677             padding-top: 2px;
678             padding-bottom: 2px;
679           }
680           .sidebar h2 {
681             font-style:italic;
682             font-size: 0.81em;
683             padding-left: 5px;
684             padding-right: 5px;
685             font-weight: normal;
686           }
687           .date {
688             font-size: 0.6em;
689             float: right;
690             font-style: italic;
691           }
692           .method, .signal, .property {
693             margin-left: 1em;
694             margin-right: 4em;
695           }
696           .rationale {
697             font-style: italic;
698             border-left: 0.25em solid #808080;
699             padding-left: 0.5em;
700           }
701
702         </style>
703       </head>
704       <body>
705         <h1 class="topbox">
706           <xsl:value-of select="tp:title" />
707         </h1>
708         <xsl:if test="tp:version">
709           <h2>Version <xsl:apply-templates select="tp:version"/></h2>
710         </xsl:if>
711         <xsl:apply-templates select="tp:copyright"/>
712         <xsl:apply-templates select="tp:license"/>
713         <xsl:apply-templates select="tp:docstring"/>
714
715         <h2>Interfaces</h2>
716         <ul>
717           <xsl:for-each select="//node/interface">
718             <li><code><a href="#{@name}"><xsl:value-of select="@name"/></a></code></li>
719           </xsl:for-each>
720         </ul>
721
722         <xsl:apply-templates select="//node"/>
723         <xsl:apply-templates select="tp:generic-types"/>
724         <xsl:apply-templates select="tp:errors"/>
725
726         <h1>Index</h1>
727         <h2>Index of interfaces</h2>
728         <ul>
729           <xsl:for-each select="//node/interface">
730             <li><code><a href="#{@name}"><xsl:value-of select="@name"/></a></code></li>
731           </xsl:for-each>
732         </ul>
733         <h2>Index of types</h2>
734         <ul>
735           <xsl:for-each select="//tp:simple-type | //tp:enum | //tp:flags | //tp:mapping | //tp:struct | //tp:external-type">
736             <xsl:sort select="@name"/>
737             <li>
738               <code>
739                 <a href="#type-{@name}">
740                   <xsl:value-of select="@name"/>
741                 </a>
742               </code>
743               <xsl:apply-templates mode="in-index" select="."/>
744             </li>
745           </xsl:for-each>
746         </ul>
747       </body>
748     </html>
749   </xsl:template>
750
751 </xsl:stylesheet>
752
753 <!-- vim:set sw=2 sts=2 et: -->