File: interface.xsl

package info (click to toggle)
displaycal-py3 3.9.17-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 29,124 kB
  • sloc: python: 115,810; javascript: 11,545; xml: 598; sh: 257; makefile: 173
file content (449 lines) | stat: -rw-r--r-- 14,269 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
				xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:zi="http://zero-install.sourceforge.net/2004/injector/interface"
				version="1.0">
	<xsl:output method="xml" encoding="utf-8"
				doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
				doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"/>
	<xsl:template match="/zi:interface">
		<html>
			<head>
				<title>
					<xsl:value-of select="zi:name"/><xsl:if test="zi:summary and zi:summary != zi:name">—<xsl:value-of select="zi:summary"/></xsl:if>
				</title>
				<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato%3A400%2C700%2C900%2C400italic%2C700italic&#038;subset=latin%2Clatin-ext" type="text/css" media="all" />
				<link rel="stylesheet" href="../theme/readme.css" />
				<link rel="stylesheet" href="interface1.css" />
			</head>
			<body>
				<h1>
					<xsl:variable name="icon-href" select="(zi:icon[@type='image/png'][1])/@href"/>
					<xsl:if test="$icon-href != ''">
						<span class="reflect"><img id="icon"
												   src="{$icon-href}"
												   alt="" /></span>
						<xsl:text> </xsl:text>
					</xsl:if>
					<xsl:choose>
						<xsl:when test="zi:homepage">
							<a href="{zi:homepage}">
								<xsl:value-of select="zi:name"/>
							</a>
						</xsl:when>
						<xsl:otherwise>
							<a href="http://{zi:name}.org/">
								<xsl:value-of select="zi:name"/>
							</a>
						</xsl:otherwise>
					</xsl:choose>
					<xsl:if test="zi:summary and zi:summary != zi:name">
						<span><span class="dash">—</span><xsl:value-of select="zi:summary"/></span>
					</xsl:if>
				</h1>
				<div id="info">
					<h2>
						This is a <strong><img src="0install-icon.png"
											   alt="" />
						Zero Install</strong> feed.
					</h2>
					<xsl:choose>
						<xsl:when test="zi:replaced-by">
							<p>
								This interface is obsolete! Please use this one
								instead:
							</p>
							<div id="box">
								<xsl:for-each select="zi:replaced-by">
									<p>
										<a class="button">
											<xsl:attribute name="href">
												<xsl:value-of select="@interface"/>
											</xsl:attribute>
											<xsl:value-of select="@interface"/>
										</a>
									</p>
								</xsl:for-each>
							</div>
						</xsl:when>
						<xsl:when test="//zi:implementation[@main] | //zi:group[@main] | //zi:command | //zi:package-implementation[@main] | //zi:entry-point">
							<xsl:choose>
								<xsl:when test="//zi:entry-point">
									<p>
										To add this program to your Applications menu,
										choose <strong>Zero Install (0install)</strong>
										from your <strong>Applications</strong> menu
										(“Start” menu under Windows), and <strong>drag
										this feed's URL into the window that
										opens.</strong>
									</p>
									<p>
										If you don't see this menu item, install the
										<code>zeroinstall-injector</code> package from
										your distribution's repository, or from
										<a href="http://0install.net/injector.html">0install.net</a>.
									</p>
									<div id="box">
										<p>
											<img src="0install.png" alt="" />
										</p>
										<p>
											<a class="button" href="{/zi:interface/@uri}">
												<xsl:value-of select="/zi:interface/@uri"/>
											</a>
										</p>
										<xsl:if test="zi:feed-for">
											<p>
												In most cases, you should use the
												interface URI instead of this feed's
												URI.
											</p>
											<xsl:for-each select="zi:feed-for">
												<p>
													<a class="button">
														<xsl:attribute name="href">
															<xsl:value-of select="@interface"/>
														</xsl:attribute>
														<xsl:value-of select="@interface"/>
													</a>
												</p>
											</xsl:for-each>
										</xsl:if>
									</div>
									<p>
										Alternatively, to run it from the command-line:
									</p>
								</xsl:when>
								<xsl:otherwise>
									<p>
										To run this program from the command-line:
									</p>
								</xsl:otherwise>
							</xsl:choose>

							<p>
								<code>
									0launch
									<xsl:choose>
										<xsl:when test="//zi:implementation[@main] | //zi:group[@main] | //zi:command[@name='run'] | //zi:package-implementation[@main]">
										</xsl:when>
										<xsl:otherwise>
											--command=COMMAND
										</xsl:otherwise>
									</xsl:choose>
									<xsl:value-of select="/zi:interface/@uri"/>
								</code>
							</p>
							<p>
								The <code>0alias</code> command can be used to
								create a short-cut to run it again later. If you
								don't have the <code>0launch</code> command,
								download it from
								<a href="http://0install.net/injector.html">0install.net</a>,
								which also contains documentation about how the
								Zero Install system works.
							</p>
						</xsl:when>
						<xsl:otherwise>
							<p>
								This software cannot be run as an application
								directly. It is a library for other programs to
								use.
							</p>
							<p>
								For more information about Zero Install, see
								<a href="http://0install.net">0install.net</a>.
							</p>
						</xsl:otherwise>
					</xsl:choose>
				</div>
				<div class="main" id="content">
					<xsl:apply-templates mode="dl" select="*|@*"/>
					<xsl:choose>
						<xsl:when test="zi:entry-point">
							<h2>Provides</h2>
							<xsl:for-each select="zi:entry-point">
								<div class="entry-point">
									<xsl:variable name="icon-href" select="(zi:icon[@type='image/png'][1])/@href"/>
									<xsl:if test="$icon-href != ''">
										<img src="{$icon-href}"
											 alt="" />
									</xsl:if>
									<div>
										<h3><xsl:value-of select="zi:name"/></h3>
										<p><xsl:value-of select="zi:description"/></p>
									</div>
								</div>
							</xsl:for-each>
						</xsl:when>
						<xsl:otherwise>
							<xsl:if test="//zi:command[@name!='run']">
								<h2>Provides</h2>
								<ul>
									<xsl:for-each select="//zi:command">
										<li>
											<xsl:value-of select="@name"/>
										</li>
									</xsl:for-each>
								</ul>
							</xsl:if>
						</xsl:otherwise>
					</xsl:choose>
					<h2>Required libraries</h2>
					<xsl:choose>
						<xsl:when test="//zi:requires|//zi:runner">
							<p>
								The list below is just for information; Zero
								Install will automatically download any required
								libraries for you.
							</p>
							<ul>
								<xsl:for-each select="//zi:requires|//zi:runner">
									<xsl:variable name="interface"
												  select="@interface"/>
									<xsl:if test="not(preceding::zi:requires[@interface = $interface]) and not(preceding::zi:runner[@interface = $interface])">
										<li>
											<a>
												<xsl:attribute name="href">
													<xsl:value-of select="$interface"/>
												</xsl:attribute>
												<xsl:value-of select="$interface"/>
											</a>
										</li>
									</xsl:if>
								</xsl:for-each>
							</ul>
						</xsl:when>
						<xsl:otherwise>
							<p>
								This feed does not list any additional
								requirements.
							</p>
						</xsl:otherwise>
					</xsl:choose>
					<xsl:if test="zi:feed">
						<h2>Other feeds for this interface</h2>
						<p>
							Zero Install will also check these feeds when
							deciding which version to use.
						</p>
						<ul>
							<xsl:for-each select="zi:feed">
								<li>
									<a>
										<xsl:attribute name="href">
											<xsl:value-of select="@src"/>
										</xsl:attribute>
										<xsl:value-of select="@src"/>
									</a>
								</li>
							</xsl:for-each>
						</ul>
					</xsl:if>
					<h2>Available versions</h2>
					<xsl:choose>
						<xsl:when test="//zi:implementation|//zi:package-implementation">
							<p>
								The list below is just for information; Zero
								Install will automatically download one of these
								versions for you.
							</p>
							<xsl:if test="//zi:implementation">
								<div id="friendlybox">
									<table id="get">
										<tr>
											<th>Version</th>
											<th>Released</th>
											<th>Stability</th>
											<th>Platform</th>
											<th>Archive</th>
										</tr>
										<xsl:for-each select="//zi:implementation">
											<xsl:variable name="stability"
														  select="(ancestor-or-self::*[@stability])[last()]/@stability"/>
											<tr>
												<xsl:if test="$stability = 'buggy' or $stability = 'insecure'">
													<xsl:attribute name="style">
														opacity: .5
													</xsl:attribute>
												</xsl:if>
												<td>
													<h2>
														<xsl:if test="$stability = 'buggy' or $stability = 'insecure'">
															<xsl:attribute name="style">
																text-decoration: line-through
															</xsl:attribute>
														</xsl:if>
														<xsl:value-of select="(ancestor-or-self::*[@version])[last()]/@version"/>
														<xsl:if test="(ancestor-or-self::*[@version])[last()]/@version-modifier">
															<xsl:value-of select="(ancestor-or-self::*[@version])[last()]/@version-modifier"/>
														</xsl:if>
														<xsl:if test="$stability = 'testing' or $stability = 'developer' or contains(.//zi:archive/@href, 'snapshot')">
															Beta
														</xsl:if>
													</h2>
													<xsl:if test="@langs">
														(<xsl:value-of select="@langs"/>)
													</xsl:if>
												</td>
												<td>
													<xsl:value-of select="(ancestor-or-self::*[@released])[last()]/@released"/>
												</td>
												<td>
													<xsl:value-of select="(ancestor-or-self::*[@stability])[last()]/@stability"/>
												</td>
												<td>
													<xsl:variable name="arch"
																  select="(ancestor-or-self::*[@arch])[last()]/@arch"/>
													<xsl:choose>
														<xsl:when test="$arch = '*-src'">
															Source code
														</xsl:when>
														<xsl:when test="not($arch) or $arch = '*-*'">
															Any
														</xsl:when>
														<xsl:otherwise>
															<xsl:value-of select="$arch"/>
														</xsl:otherwise>
													</xsl:choose>
												</td>
												<td class="download">
													<xsl:apply-templates select=".//zi:archive | .//zi:file" />
												</td>
											</tr>
										</xsl:for-each>
									</table>
								</div>
							</xsl:if>
							<xsl:if test="//zi:package-implementation">
								<p>
									Non-Zero Install packages
									provided by distributions can
									provide this interface:
								</p>
								<table id="packages">
									<tr>
										<th>Distribution</th>
										<th>Package name</th>
									</tr>
									<xsl:for-each select="//zi:package-implementation">
										<tr>
											<td>
												<xsl:value-of select="(ancestor-or-self::*[@distributions])[last()]/@distributions"/>
											</td>
											<td>
												<xsl:value-of select="(ancestor-or-self::*[@package])[last()]/@package"/>
											</td>
										</tr>
									</xsl:for-each>
								</table>
							</xsl:if>
						</xsl:when>
						<xsl:otherwise>
							<p>
								No versions are available for downlad.
							</p>
						</xsl:otherwise>
					</xsl:choose>
				</div>
			</body>
		</html>
	</xsl:template>
	<!--xsl:template mode="dl" match="/zi:interface/@uri">
		<dt>Full URL</dt>
		<dd>
			<p>
				<a href="{.}">
					<xsl:value-of select="."/>
				</a>
			</p>
		</dd>
	</xsl:template-->
	<!--xsl:template mode="dl" match="zi:homepage">
		<dt>Homepage</dt>
		<dd>
			<p>
				<a href="{.}">
					<xsl:value-of select="."/>
				</a>
			</p>
		</dd>
	</xsl:template-->
	<xsl:template mode="dl" match="zi:description">
		<h2>Description</h2>
		<div class="description">
			<xsl:call-template name="description">
				<xsl:with-param name="text"><xsl:value-of select="."/></xsl:with-param>
			</xsl:call-template>
		</div>
	</xsl:template>
	<xsl:template name="description">
		<xsl:param name="text"/>
		<xsl:if test="normalize-space($text)">
			<xsl:variable name="first" select="substring-before($text, '&#xa;&#xa;')"/>
			<xsl:choose>
				<xsl:when test="normalize-space($first)">
					<p><xsl:value-of select="$first"/></p>
					<xsl:call-template name="description">
						<xsl:with-param name="text"><xsl:value-of select="substring-after($text, '&#xa;&#xa;')"/></xsl:with-param>
					</xsl:call-template>
				</xsl:when>
				<xsl:otherwise>
					<p><xsl:value-of select="$text"/></p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<!--xsl:template mode="dl" match="zi:icon">
		<dt>Icon</dt>
		<dd>
			<p>
				<img src="{@href}" class="alpha"/>
			</p>
		</dd>
	</xsl:template-->
	<xsl:template mode="dl" match="*|@*"/>
	<xsl:template match="zi:group">
		<dl class="group">
			<xsl:apply-templates mode="attribs"
								 select="@stability|@version|@id|@arch|@released"/>
			<xsl:apply-templates select="zi:group|zi:requires|zi:runner|zi:implementation"/>
		</dl>
	</xsl:template>
	<xsl:template match="zi:requires | zi:runner">
		<dt>Requires</dt>
		<dd>
			<a href="{@interface}">
				<xsl:value-of select="@interface"/>
			</a>
		</dd>
	</xsl:template>
	<xsl:template match="zi:implementation">
		<dl class="impl">
			<xsl:apply-templates mode="attribs"
								 select="@stability|@version|@id|@arch|@released"/>
			<xsl:apply-templates/>
		</dl>
	</xsl:template>
	<xsl:template mode="attribs" match="@*">
		<dt>
			<xsl:value-of select="name(.)"/>
		</dt>
		<dd>
			<xsl:value-of select="."/>
		</dd>
	</xsl:template>
	<xsl:template match="zi:archive | zi:file">
		<xsl:variable name="stability"
					  select="(ancestor-or-self::*[@stability])[last()]/@stability"/>
		<span>
			<xsl:if test="$stability = 'buggy' or $stability = 'insecure'">
				<xsl:attribute name="style">
					visibility: hidden
				</xsl:attribute>
			</xsl:if>
			<a href="{@href}">Download</a>
			(<xsl:value-of select="format-number(@size div 1024 div 1024, '####0.00')"/> MiB)
		</span>
	</xsl:template>
</xsl:stylesheet>