Mercurial > touhou-doc
annotate html.xsl @ 13:2925b0e246c6 default tip
Fix a lot of things, and add a TODO.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 17 Feb 2012 12:54:08 +0100 |
parents | 79dfd9765a67 |
children |
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 |
13
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
36 <x:variable name="ref" select="o:params/@ref"/> |
0 | 37 <x:choose> |
13
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
38 <x:when test="o:params/@ref"> |
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
39 <x:call-template name="params"> |
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
40 <x:with-param name="params" select="/o:opcodes/o:op[o:num = $ref]/o:params/o:param"/> |
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
41 </x:call-template> |
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
42 </x:when> |
0 | 43 <x:when test="o:params"> |
44 <x:apply-templates select="o:params"/> | |
45 </x:when> | |
46 <x:otherwise> | |
47 <p>Takes no parameters.</p> | |
48 </x:otherwise> | |
49 </x:choose> | |
50 | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
51 <x:apply-templates select="o:desc"/> |
0 | 52 </x:template> |
53 | |
13
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
54 <x:template name="params" match="o:params"> |
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
55 <x:param name="params" select="o:param"/> |
0 | 56 <table> |
57 <tr> | |
58 <th>Type</th> | |
13
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
59 <x:if test="$params/@name"><th>Name</th></x:if> |
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
60 <x:if test="$params/@unit"><th>Unit</th></x:if> |
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
61 <x:if test="$params/@var"><th>Variable</th></x:if> |
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
62 <x:if test="$params != ''"><th>Notes</th></x:if> |
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
63 <x:if test="$params/@values"><th>Values</th></x:if> |
0 | 64 </tr> |
13
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
65 <x:apply-templates select="$params"/> |
0 | 66 </table> |
67 </x:template> | |
68 | |
69 <x:template match="o:param"> | |
70 <tr> | |
71 <td><x:apply-templates select="@type"/></td> | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
72 <x:if test="../o:param/@name"> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
73 <td><x:value-of select="@name"/></td> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
74 </x:if> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
75 <x:if test="../o:param/@unit"> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
76 <td><x:value-of select="@unit"/></td> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
77 </x:if> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
78 <x:if test="../o:param/@var"> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
79 <td><x:value-of select="@var"/></td> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
80 </x:if> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
81 <x:if test="../o:param != ''"> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
82 <td><x:value-of select="."/></td> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
83 </x:if> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
84 <x:if test="../o:param/@values"> |
0 | 85 <td><x:value-of select="@values"/></td> |
86 </x:if> | |
87 </tr> | |
88 </x:template> | |
89 | |
90 <x:template match="@type"> | |
91 <x:choose> | |
92 <x:when test=". = 'c'">int8</x:when> | |
93 <x:when test=". = 's'">int16</x:when> | |
94 <x:when test=". = 'S'">int32</x:when> | |
95 <x:when test=". = 'b'">uint8</x:when> | |
96 <x:when test=". = 'u'">uint16</x:when> | |
97 <x:when test=". = 'U'">uint32</x:when> | |
98 <x:when test=". = 'f'">float</x:when> | |
99 <x:when test=". = 'd'">double</x:when> | |
100 <x:when test=". = 'z'">string</x:when> | |
101 <x:when test=". = 'm'">data</x:when> | |
102 <x:otherwise><x:value-of select="."/></x:otherwise> | |
103 </x:choose> | |
104 </x:template> | |
105 | |
106 <x:template match="o:desc"> | |
13
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
107 <p> |
0 | 108 <x:choose> |
13
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
109 <x:when test="h:div"> |
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
110 <x:for-each select="h:div/*"> |
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
111 <x:call-template name="xhtml"/> |
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
112 </x:for-each> |
0 | 113 </x:when> |
114 <x:otherwise> | |
13
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
115 <x:apply-templates/> |
0 | 116 </x:otherwise> |
117 </x:choose> | |
13
2925b0e246c6
Fix a lot of things, and add a TODO.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
118 </p> |
0 | 119 </x:template> |
120 | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
121 <x:template name="xhtml" match="node() | @*"> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
122 <x:copy> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
123 <x:apply-templates select="node() | @*" /> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
124 </x:copy> |
0 | 125 </x:template> |
126 | |
12
79dfd9765a67
I *really* should commit more often.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
127 <x:template match="o:p"><p><x:apply-templates/></p></x:template> |
79dfd9765a67
I *really* should commit more often.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
128 <x:template match="o:pre"><pre><x:apply-templates/></pre></x:template> |
79dfd9765a67
I *really* should commit more often.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
129 <x:template match="o:br"><br/></x:template> |
0 | 130 |
12
79dfd9765a67
I *really* should commit more often.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
131 <x:template match="o:dl"><dl><x:apply-templates/></dl></x:template> |
79dfd9765a67
I *really* should commit more often.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
132 <x:template match="o:dt"><dt><x:apply-templates/></dt></x:template> |
79dfd9765a67
I *really* should commit more often.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
133 <x:template match="o:dd"><dd><x:apply-templates/></dd></x:template> |
0 | 134 |
12
79dfd9765a67
I *really* should commit more often.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
135 <x:template match="o:table"><table><x:apply-templates/></table></x:template> |
79dfd9765a67
I *really* should commit more often.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
136 <x:template match="o:tr"><tr><x:apply-templates/></tr></x:template> |
79dfd9765a67
I *really* should commit more often.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
137 <x:template match="o:th"><th><x:apply-templates/></th></x:template> |
79dfd9765a67
I *really* should commit more often.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
138 <x:template match="o:td"><td><x:apply-templates/></td></x:template> |
0 | 139 |
12
79dfd9765a67
I *really* should commit more often.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
140 <x:template match="o:ol"><ol><x:apply-templates/></ol></x:template> |
79dfd9765a67
I *really* should commit more often.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
141 <x:template match="o:li"><li><x:apply-templates/></li></x:template> |
79dfd9765a67
I *really* should commit more often.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
142 |
79dfd9765a67
I *really* should commit more often.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
143 <x:template match="o:a"><a href="{@href}"><x:apply-templates/></a></x:template> |
79dfd9765a67
I *really* should commit more often.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
144 <x:template match="o:code"><code><x:apply-templates/></code></x:template> |
79dfd9765a67
I *really* should commit more often.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
145 <x:template match="o:sup"><sup><x:apply-templates/></sup></x:template> |
0 | 146 |
147 <x:template match="o:stage"> | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
148 <x:text>stage </x:text><x:value-of select="."/> |
0 | 149 </x:template> |
150 | |
151 <x:template match="o:ref"> | |
5
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
152 <x:variable name="ref" select="."/> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
153 <a href="#i{$ref}"> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
154 <x:choose> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
155 <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
|
156 <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
|
157 </x:when> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
158 <x:otherwise> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
159 <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
|
160 </x:otherwise> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
161 </x:choose> |
b3644dff344c
Way too much changes. :/
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
162 </a> |
0 | 163 </x:template> |
164 </x:stylesheet> |