Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 27149
Collapse All | Expand All

(-)htdocs/xsl/guide-print.xsl (-338 / +1 lines)
Lines 1-10 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
	<xsl:output encoding="iso-8859-15" method="html" indent="yes" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
3
    <xsl:import href="guide.xsl"/>
4
	<xsl:preserve-space elements="pre"/>
5
	<xsl:template match="img">
6
		<img src="{@src}"/>
7
	</xsl:template>
8
	<xsl:template match="/guide">
4
	<xsl:template match="/guide">
9
	<html>
5
	<html>
10
	<head>
6
	<head>
Lines 42-378 Link Here
42
	  </body>
38
	  </body>
43
    </html>
39
    </html>
44
  </xsl:template>
40
  </xsl:template>
45
  <xsl:template match="mail">
46
    <a href="mailto:{@link}">
47
      <xsl:value-of select="."/>
48
    </a>
49
  </xsl:template>
50
  <xsl:template match="author/mail">
51
    <b>
52
      <a class="altlink" href="mailto:{@link}">
53
        <xsl:value-of select="."/>
54
      </a>
55
    </b>
56
  </xsl:template>
57
  <xsl:template match="author">
58
    <xsl:apply-templates/>
59
    <xsl:if test="@title">
60
      <br/>
61
      <i>
62
        <xsl:value-of select="@title"/>
63
      </i>
64
    </xsl:if>
65
    <br/>
66
    <br/>
67
  </xsl:template>
68
  <xsl:template match="chapter">
69
    <xsl:variable name="chid"><xsl:number/></xsl:variable>
70
    <xsl:choose>
71
      <xsl:when test="title">
72
        <p class="chaphead">
73
          <font class="chapnum">
74
            <a name="doc_chap{$chid}"><xsl:number/>.</a>
75
          </font>
76
          <xsl:value-of select="title"/>
77
        </p>
78
      </xsl:when>
79
      <xsl:otherwise>
80
        <xsl:if test="/guide">
81
          <p class="chaphead">
82
            <font class="chapnum">
83
              <a name="doc_chap{$chid}"><xsl:number/>.</a>
84
            </font>
85
          </p>
86
        </xsl:if>
87
      </xsl:otherwise>
88
    </xsl:choose>
89
    <xsl:apply-templates select="body">
90
      <xsl:with-param name="chid" select="$chid"/>
91
    </xsl:apply-templates>
92
    <xsl:apply-templates select="section">
93
      <xsl:with-param name="chid" select="$chid"/>
94
    </xsl:apply-templates>
95
  </xsl:template>
96
  <xsl:template match="section">
97
    <xsl:param name="chid"/>
98
    <xsl:if test="title">
99
      <xsl:variable name="sectid">doc_chap<xsl:value-of select="$chid"/>_sect<xsl:number/></xsl:variable>
100
      <p class="secthead">
101
        <a name="{$sectid}"><xsl:value-of select="title"/>&#160;</a>
102
      </p>
103
    </xsl:if>
104
    <xsl:apply-templates select="body">
105
      <xsl:with-param name="chid" select="$chid"/>
106
    </xsl:apply-templates>
107
  </xsl:template>
108
<!--  
109
  <xsl:template match="subsection">
110
    <xsl:param name="chapid"/>
111
    <xsl:if test="title">
112
      <xsl:variable name="subsectid"><xsl:value-of select="$chapid"/>_subsect<xsl:number/></xsl:variable>
113
      <p class="subsecthead">
114
        <a name="{$subsectid}"><xsl:value-of select="title"/>&#160;</a>
115
      </p>
116
    </xsl:if>
117
    <xsl:apply-templates select="body"/>
118
  </xsl:template>
119
-->
120
  <xsl:template match="figure">
121
    <xsl:with-param name="chid"/>
122
    <xsl:variable name="fignum">
123
      <xsl:number level="any" from="chapter" count="figure"/>
124
    </xsl:variable>
125
    <xsl:variable name="figid">doc_chap<xsl:value-of select="$chid"/>_fig<xsl:value-of select="$fignum"/></xsl:variable>
126
    <br/>
127
    <a name="{$figid}"/>
128
    <table cellspacing="0" cellpadding="0" border="0">
129
      <tr>
130
        <td class="infohead" bgcolor="#7a5ada">
131
          <p class="caption">
132
            <xsl:choose>
133
              <xsl:when test="@caption">
134
				Figure <xsl:value-of select="$chid"/>.<xsl:value-of select="$fignum"/>: <xsl:value-of select="@caption"/>
135
			</xsl:when>
136
              <xsl:otherwise>
137
				Figure <xsl:value-of select="$chid"/>.<xsl:value-of select="$fignum"/>
138
			</xsl:otherwise>
139
            </xsl:choose>
140
          </p>
141
        </td>
142
      </tr>
143
      <tr>
144
        <td align="center" bgcolor="#ddddff">
145
          <xsl:choose>
146
            <xsl:when test="@short">
147
              <img src="{@link}" alt="Fig. {$fignum}: {@short}"/>
148
            </xsl:when>
149
            <xsl:otherwise>
150
              <img src="{@link}" alt="Fig. {$fignum}"/>
151
            </xsl:otherwise>
152
          </xsl:choose>
153
        </td>
154
      </tr>
155
    </table>
156
    <br/>
157
  </xsl:template>
158
<!--figure without a caption; just a graphical element-->
159
  <xsl:template match="fig">
160
    <center>
161
      <xsl:choose>
162
        <xsl:when test="@linkto">
163
          <a href="{@linkto}">
164
            <img src="{@link}" alt="{@short}"/>
165
          </a>
166
        </xsl:when>
167
        <xsl:otherwise>
168
          <img src="{@link}" alt="{@short}"/>
169
        </xsl:otherwise>
170
      </xsl:choose>
171
    </center>
172
  </xsl:template>
173
  <xsl:template match="br">
174
    <br/>
175
  </xsl:template>
176
  <xsl:template match="note">
177
    <table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0">
178
      <tr>
179
        <td bgcolor="#bbffbb">
180
          <p class="note">
181
            <b>Note: </b>
182
            <xsl:apply-templates/>
183
          </p>
184
        </td>
185
      </tr>
186
    </table>
187
  </xsl:template>
188
  <xsl:template match="impo">
189
    <table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0">
190
      <tr>
191
        <td bgcolor="#ffffbb">
192
          <p class="note">
193
            <b>Important: </b>
194
            <xsl:apply-templates/>
195
          </p>
196
        </td>
197
      </tr>
198
    </table>
199
  </xsl:template>
200
  <xsl:template match="warn">
201
    <table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0">
202
      <tr>
203
        <td bgcolor="#ffbbbb">
204
          <p class="note">
205
            <b>Warning: </b>
206
            <xsl:apply-templates/>
207
          </p>
208
        </td>
209
      </tr>
210
    </table>
211
  </xsl:template>
212
  <xsl:template match="codenote">
213
    <font class="comment">// <xsl:value-of select="."/></font>
214
  </xsl:template>
215
  <xsl:template match="comment">
216
    <font class="comment">
217
      <xsl:apply-templates/>
218
    </font>
219
  </xsl:template>
220
  <xsl:template match="i">
221
    <font class="input">
222
      <xsl:apply-templates/>
223
    </font>
224
  </xsl:template>
225
  <xsl:template match="b">
226
    <b>
227
      <xsl:apply-templates/>
228
    </b>
229
  </xsl:template>
230
  <xsl:template match="brite">
231
    <font color="#ff0000">
232
      <b>
233
        <xsl:apply-templates/>
234
      </b>
235
    </font>
236
  </xsl:template>
237
  
238
  <xsl:template match="body">
239
    <xsl:param name="chid"/>
240
    <xsl:apply-templates>
241
      <xsl:with-param name="chid" select="$chid"/>
242
    </xsl:apply-templates>
243
  </xsl:template>
244
  <xsl:template match="c">
245
    <font class="code">
246
      <xsl:apply-templates/>
247
    </font>
248
  </xsl:template>
249
  <xsl:template match="box">
250
    <p class="infotext">
251
      <xsl:apply-templates/>
252
    </p>
253
  </xsl:template>
254
  
255
  <xsl:template match="pre">
256
    <xsl:param name="chid"/>
257
    <xsl:variable name="prenum">
258
      <xsl:number level="any" from="chapter" count="pre"/>
259
    </xsl:variable>
260
    <xsl:variable name="preid">doc_chap<xsl:value-of select="$chid"/>_pre<xsl:value-of select="$prenum"/></xsl:variable>
261
    <a name="{$preid}"/>
262
    <table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0">
263
      <tr>
264
        <td class="infohead" bgcolor="#7a5ada">
265
          <p class="caption">
266
            <xsl:choose>
267
              <xsl:when test="@caption">
268
			Code listing <xsl:value-of select="$chid"/>.<xsl:value-of select="$prenum"/>: <xsl:value-of select="@caption"/>
269
		</xsl:when>
270
              <xsl:otherwise>
271
			Code listing <xsl:value-of select="$chid"/>.<xsl:value-of select="$prenum"/>
272
		</xsl:otherwise>
273
            </xsl:choose>
274
          </p>
275
        </td>
276
      </tr>
277
      <tr>
278
        <td bgcolor="#ddddff">
279
          <pre>
280
            <xsl:apply-templates/>
281
          </pre>
282
        </td>
283
      </tr>
284
    </table>
285
  </xsl:template>
286
  <xsl:template match="path">
287
    <font class="path">
288
      <xsl:value-of select="."/>
289
    </font>
290
  </xsl:template>
291
  <xsl:template match="uri">
292
<!-- expand templates to handle things like <uri link="http://bar"><c>foo</c></uri> -->
293
    <xsl:choose>
294
      <xsl:when test="@link">
295
        <a href="{@link}">
296
          <xsl:apply-templates/>
297
        </a>
298
      </xsl:when>
299
      <xsl:otherwise>
300
        <xsl:variable name="loc" select="."/>
301
        <a href="{$loc}">
302
          <xsl:apply-templates/>
303
        </a>
304
      </xsl:otherwise>
305
    </xsl:choose>
306
  </xsl:template>
307
  <xsl:template match="p">
308
    <xsl:param name="chid"/>
309
      <xsl:choose>
310
      <xsl:when test="@class">
311
 		<p class="{@class}">
312
      		<xsl:apply-templates>
313
		<xsl:with-param name="chid" select="$chid"/>
314
		</xsl:apply-templates>
315
    		</p>
316
    	</xsl:when>
317
    	<xsl:otherwise>
318
		<p>
319
	      	<xsl:apply-templates>
320
 		<xsl:with-param name="chid" select="$chid"/>
321
		</xsl:apply-templates>
322
    		</p>
323
    	</xsl:otherwise>
324
	</xsl:choose>
325
  </xsl:template>
326
  <xsl:template match="e">
327
    <font class="emphasis">
328
      <xsl:apply-templates/>
329
    </font>
330
  </xsl:template>
331
  <xsl:template match="mail">
332
    <a href="mailto:{@link}">
333
      <xsl:value-of select="."/>
334
    </a>
335
  </xsl:template>
336
  <xsl:template match="table">
337
    <table class="ntable">
338
      <xsl:apply-templates/>
339
    </table>
340
  </xsl:template>
341
  <xsl:template match="tr">
342
    <tr>
343
      <xsl:apply-templates/>
344
    </tr>
345
  </xsl:template>
346
  <xsl:template match="ti">
347
    <td bgcolor="#ddddff" class="tableinfo">
348
      <xsl:apply-templates/>
349
    </td>
350
  </xsl:template>
351
  <xsl:template match="th">
352
    <td bgcolor="#7a5ada" class="infohead">
353
      <b>
354
        <xsl:apply-templates/>
355
      </b>
356
    </td>
357
  </xsl:template>
358
  <xsl:template match="ul">
359
    <ul>
360
      <xsl:apply-templates/>
361
    </ul>
362
  </xsl:template>
363
  <xsl:template match="ol">
364
    <ol>
365
      <xsl:apply-templates/>
366
    </ol>
367
  </xsl:template>
368
  <xsl:template match="li">
369
    <li>
370
      <xsl:apply-templates/>
371
    </li>
372
  </xsl:template>
373
<xsl:template match="license">
374
<pre>
375
his work is licensed under the <a href="http://creativecommons.org/licenses/by-sa/1.0">Creative Commons - Attribution / Share Alike</a> license.
376
</pre>
377
</xsl:template>
378
</xsl:stylesheet>
41
</xsl:stylesheet>

Return to bug 27149