Mercurial > touhou-doc
annotate html.xsl @ 6:578e67aa3c03
Minor ECL fixes.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 23 Aug 2011 20:52:55 +0200 |
parents | b3644dff344c |
children | 79dfd9765a67 |
rev | line source |
---|---|
0 | 1 <?xml version="1.0" encoding="utf-8"?> |
2 <x:stylesheet version="1.0" | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
3 exclude-result-prefixes="o h" |
0 | 4 xmlns:x="http://www.w3.org/1999/XSL/Transform" |
5 xmlns:o="urn:opcodes:description" | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
6 xmlns:h="http://www.w3.org/1999/xhtml" |
0 | 7 xmlns="http://www.w3.org/1999/xhtml"> |
8 | |
9 <x:output encoding="utf-8" indent="yes" method="xml" /> | |
10 | |
11 <x:template match="/o:opcodes"> | |
12 <html> | |
13 <head> | |
14 <title><x:value-of select="o:title"/></title> | |
15 </head> | |
16 <body> | |
17 <h1><x:value-of select="o:title"/></h1> | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
18 |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
19 <x:for-each select="o:text/h:div/*"> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
20 <x:call-template name="xhtml"/> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
21 </x:for-each> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
22 |
0 | 23 <x:apply-templates select="o:op"/> |
24 </body> | |
25 </html> | |
26 </x:template> | |
27 | |
28 <x:template match="o:op"> | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
29 <h3 id="i{o:num}"> |
0 | 30 <x:value-of select="o:num"/> |
31 <x:if test="o:name != ''"> | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
32 <x:text> - </x:text><small><x:value-of select="o:name"/></small> |
0 | 33 </x:if> |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
34 </h3> |
0 | 35 |
36 <x:choose> | |
37 <x:when test="o:params"> | |
38 <x:apply-templates select="o:params"/> | |
39 </x:when> | |
40 <x:otherwise> | |
41 <p>Takes no parameters.</p> | |
42 </x:otherwise> | |
43 </x:choose> | |
44 | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
45 <x:apply-templates select="o:desc"/> |
0 | 46 </x:template> |
47 | |
48 <x:template match="o:params"> | |
49 <table> | |
50 <tr> | |
51 <th>Type</th> | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
52 <x:if test="o:param/@name"><th>Name</th></x:if> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
53 <x:if test="o:param/@unit"><th>Unit</th></x:if> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
54 <x:if test="o:param/@var"><th>Variable</th></x:if> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
55 <x:if test="o:param != ''"><th>Notes</th></x:if> |
0 | 56 <x:if test="o:param/@values"><th>Values</th></x:if> |
57 </tr> | |
58 <x:apply-templates select="o:param"/> | |
59 </table> | |
60 </x:template> | |
61 | |
62 <x:template match="o:param"> | |
63 <tr> | |
64 <td><x:apply-templates select="@type"/></td> | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
65 <x:if test="../o:param/@name"> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
66 <td><x:value-of select="@name"/></td> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
67 </x:if> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
68 <x:if test="../o:param/@unit"> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
69 <td><x:value-of select="@unit"/></td> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
70 </x:if> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
71 <x:if test="../o:param/@var"> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
72 <td><x:value-of select="@var"/></td> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
73 </x:if> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
74 <x:if test="../o:param != ''"> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
75 <td><x:value-of select="."/></td> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
76 </x:if> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
77 <x:if test="../o:param/@values"> |
0 | 78 <td><x:value-of select="@values"/></td> |
79 </x:if> | |
80 </tr> | |
81 </x:template> | |
82 | |
83 <x:template match="@type"> | |
84 <x:choose> | |
85 <x:when test=". = 'c'">int8</x:when> | |
86 <x:when test=". = 's'">int16</x:when> | |
87 <x:when test=". = 'S'">int32</x:when> | |
88 <x:when test=". = 'b'">uint8</x:when> | |
89 <x:when test=". = 'u'">uint16</x:when> | |
90 <x:when test=". = 'U'">uint32</x:when> | |
91 <x:when test=". = 'f'">float</x:when> | |
92 <x:when test=". = 'd'">double</x:when> | |
93 <x:when test=". = 'z'">string</x:when> | |
94 <x:when test=". = 'm'">data</x:when> | |
95 <x:otherwise><x:value-of select="."/></x:otherwise> | |
96 </x:choose> | |
97 </x:template> | |
98 | |
99 <x:template match="o:desc"> | |
100 <x:choose> | |
101 <x:when test="o:p"> | |
102 <x:apply-templates/> | |
103 </x:when> | |
104 <x:otherwise> | |
105 <p><x:apply-templates/></p> | |
106 </x:otherwise> | |
107 </x:choose> | |
108 </x:template> | |
109 | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
110 <x:template name="xhtml" match="node() | @*"> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
111 <x:copy> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
112 <x:apply-templates select="node() | @*" /> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
113 </x:copy> |
0 | 114 </x:template> |
115 | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
116 <x:template match="o:p"> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
117 <p><x:apply-templates/></p> |
0 | 118 </x:template> |
119 | |
120 <x:template match="o:br"> | |
121 <br/> | |
122 </x:template> | |
123 | |
124 <x:template match="o:ol"> | |
125 <ol><x:apply-templates/></ol> | |
126 </x:template> | |
127 | |
128 <x:template match="o:li"> | |
129 <li><x:apply-templates/></li> | |
130 </x:template> | |
131 | |
132 <x:template match="o:stage"> | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
133 <x:text>stage </x:text><x:value-of select="."/> |
0 | 134 </x:template> |
135 | |
136 <x:template match="o:ref"> | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
137 <x:variable name="ref" select="."/> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
138 <a href="#i{$ref}"> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
139 <x:choose> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
140 <x:when test="/o:opcodes/o:op[o:num = $ref]/o:name = ''"> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
141 <x:text>instruction </x:text><x:value-of select="$ref"/> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
142 </x:when> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
143 <x:otherwise> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
144 <x:value-of select="/o:opcodes/o:op[o:num = $ref]/o:name"/> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
145 </x:otherwise> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
146 </x:choose> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
147 </a> |
0 | 148 </x:template> |
149 </x:stylesheet> |