When adding a new implementation, choose a sensible place to put it by default.
[0publish-gui.git] / interface.xsl
blob0fe049ef10f6ef5b552eb208d81e76d3c5f56a74
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:zi="http://zero-install.sourceforge.net/2004/injector/interface"
5 version="1.0">
7 <xsl:output method="xml" encoding="utf-8"
8 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
9 doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"/>
11 <xsl:template match="/zi:interface">
12 <html>
13 <head>
14 <title>
15 <xsl:value-of select="zi:name"/>
16 </title>
17 <style type='text/css'>
18 body { margin: 2em; background: white; color: black;}
19 dt { font-weight: bold; text-transform:capitalize; }
20 dd { padding-bottom: 1em; }
21 dl.group { margin: 0.5em; padding: 0.5em; border: 1px dashed #888;}
22 dl.impl { padding: 0.2em 1em 0.2em 1em; margin: 0.5em; border: 1px solid black; background: #ffa;}
23 pre { background: #ddd; color: black; padding: 0.2cm; }
24 </style>
25 </head>
26 <body>
27 <h1><xsl:value-of select="zi:name"/> - <xsl:value-of select='zi:summary'/></h1>
28 <p>This is a Zero Install feed. To run this program from the command-line, use this
29 command:</p>
30 <pre>$ 0launch <xsl:value-of select='/zi:interface/@uri'/></pre>
31 <p>
32 The <b>0alias</b> command can be used to create a short-cut to run it again later.
33 </p>
34 <p>
35 Users of graphical environments can drag <a href='{/zi:interface/@uri}'>the feed's URL</a> to
36 an installer such as <a href='http://rox.sourceforge.net/desktop/AddApp'>AddApp</a>
37 or <a href='http://rox.sourceforge.net/desktop/node/269'>the Xfce 4.4 panel</a>.
38 </p>
39 <p>
40 If you don't have the <b>0launch</b> command, download it from
41 <a href='http://0install.net/injector.html'>the 0install.net web-site</a>, which also contains
42 documentation about how the Zero Install system works.</p>
44 <dl>
45 <xsl:apply-templates mode='dl' select='*|@*'/>
46 </dl>
47 <h2>Available versions</h2>
48 <p>The list below is just for information; Zero Install will automatically download one of
49 these versions for you.
50 </p>
51 <xsl:apply-templates select='zi:group|zi:requires|zi:implementation'/>
52 </body>
53 </html>
54 </xsl:template>
56 <xsl:template mode='dl' match='/zi:interface/@uri'>
57 <dt>Full name</dt><dd><a href='{.}'><xsl:value-of select="."/></a></dd>
58 </xsl:template>
60 <xsl:template mode='dl' match='zi:homepage'>
61 <dt>Homepage</dt><dd><a href='{.}'><xsl:value-of select="."/></a></dd>
62 </xsl:template>
64 <xsl:template mode='dl' match='zi:description'>
65 <dt>Description</dt><dd><xsl:value-of select="."/></dd>
66 </xsl:template>
68 <xsl:template mode='dl' match='zi:icon'>
69 <dt>Icon</dt><dd><img src='{@href}'/></dd>
70 </xsl:template>
72 <xsl:template mode='dl' match='*|@*'/>
74 <xsl:template match='zi:group'>
75 <dl class='group'>
76 <xsl:apply-templates mode='attribs' select='@stability|@version|@id|@arch|@released'/>
77 <xsl:apply-templates select='zi:group|zi:requires|zi:implementation'/>
78 </dl>
79 </xsl:template>
81 <xsl:template match='zi:requires'>
82 <dt>Requires</dt>
83 <dd><a href='{@interface}'><xsl:value-of select='@interface'/></a></dd>
84 </xsl:template>
86 <xsl:template match='zi:implementation'>
87 <dl class='impl'>
88 <xsl:apply-templates mode='attribs' select='@stability|@version|@id|@arch|@released'/>
89 <xsl:apply-templates/>
90 </dl>
91 </xsl:template>
93 <xsl:template mode='attribs' match='@*'>
94 <dt><xsl:value-of select='name(.)'/></dt>
95 <dd><xsl:value-of select='.'/></dd>
96 </xsl:template>
98 <xsl:template match='zi:archive'>
99 <dt>Download</dt>
100 <dd><a href='{@href}'><xsl:value-of select='@href'/></a>
101 (<xsl:value-of select='@size'/> bytes)</dd>
102 </xsl:template>
104 </xsl:stylesheet>