Allow testall to be run from anywhere.
[0publish-gui.git] / interface.xsl
blob2a128b95080e01e9b4ce472633a2de167313ddaf
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 html { background: #d0d0ff; }
19 body { background: #d0d0ff; margin: 0; padding: 0; color: black;}
20 h1 { text-align: center; border-bottom: 2px solid #d0d0ff; padding-bottom: .5em; }
21 div.main { padding: 1em; background: white;
22 -moz-border-radius: 1em 1em 1em 1em; max-width: 60em;
23 margin-left: auto; margin-right: auto;
24 margin-top: 1em; margin-bottom: 1em;}
25 dt { font-weight: bold; text-transform:capitalize; }
26 dd { padding-bottom: 1em; }
27 dl.group { margin: 0.5em; padding: 0.5em; border: 1px dashed #888;}
28 dl.impl { padding: 0.2em 1em 0.2em 1em; margin: 0.5em; border: 1px solid black; background: white;}
29 pre { background: #ddd; color: black; padding: 0.2cm; }
30 table { width: 100% }
31 th { background: #d0d0ff; text-align: left; }
32 td { background: #e0e0ff; text-align: left; }
33 </style>
34 </head>
35 <body>
36 <div class='main'>
37 <h1><xsl:value-of select="zi:name"/> - <xsl:value-of select='zi:summary'/></h1>
39 <dl>
40 <dt>Overview</dt>
41 <dd>
42 <xsl:choose>
43 <xsl:when test='//zi:implementation[@main] | //zi:group[@main]'>
44 <p>This is a Zero Install feed. To run this program from the command-line, use this
45 command:</p>
46 <pre>$ 0launch <xsl:value-of select='/zi:interface/@uri'/></pre>
47 <p>
48 The <b>0alias</b> command can be used to create a short-cut to run it again later.
49 </p>
50 <p>
51 If you use a graphical desktop, you can drag <a href='{/zi:interface/@uri}'>the feed's URL</a> to
52 an installer such as <a href='http://rox.sourceforge.net/desktop/AddApp'>AddApp</a> (ROX),
53 <a href='http://rox.sourceforge.net/desktop/node/269'>the Xfce 4.4 panel</a>, or
54 <a href='http://rox.sourceforge.net/desktop/node/402'>Zero2Desktop</a> (GNOME and KDE).
55 </p>
56 <p>
57 If you don't have the <b>0launch</b> command, download it from
58 <a href='http://0install.net/injector.html'>the 0install.net web-site</a>, which also contains
59 documentation about how the Zero Install system works.</p>
60 </xsl:when>
61 <xsl:otherwise>
62 <p>This is a Zero Install feed.
63 This software cannot be run as an application directly. It is a library for other programs to use.</p>
64 <p>For more information about Zero Install, see <a href='http://0install.net'>0install.net</a>.</p>
65 </xsl:otherwise>
66 </xsl:choose>
67 </dd>
69 <xsl:apply-templates mode='dl' select='*|@*'/>
70 <dt>Available versions</dt>
71 <dd>
72 <p>The list below is just for information; Zero Install will automatically download one of
73 these versions for you.
74 </p>
75 <table>
76 <tr><th>Version</th><th>Released</th><th>Stability</th><th>Download</th></tr>
77 <xsl:for-each select='//zi:implementation'>
78 <tr>
79 <td><xsl:value-of select='(ancestor-or-self::*[@version])[last()]/@version'/></td>
80 <td><xsl:value-of select='(ancestor-or-self::*[@released])[last()]/@released'/></td>
81 <td><xsl:value-of select='(ancestor-or-self::*[@stability])[last()]/@stability'/></td>
82 <td>
83 <xsl:for-each select='.//zi:archive'>
84 <a href='{@href}'>Download</a> (<xsl:value-of select='@size'/> bytes)
85 </xsl:for-each>
86 </td>
87 </tr>
88 </xsl:for-each>
89 </table>
90 </dd>
91 </dl>
92 </div>
93 </body>
94 </html>
95 </xsl:template>
97 <xsl:template mode='dl' match='/zi:interface/@uri'>
98 <dt>Full name</dt><dd><p><a href='{.}'><xsl:value-of select="."/></a></p></dd>
99 </xsl:template>
101 <xsl:template mode='dl' match='zi:homepage'>
102 <dt>Homepage</dt><dd><p><a href='{.}'><xsl:value-of select="."/></a></p></dd>
103 </xsl:template>
105 <xsl:template mode='dl' match='zi:description'>
106 <dt>Description</dt><dd><p><xsl:value-of select="."/></p></dd>
107 </xsl:template>
109 <xsl:template mode='dl' match='zi:icon'>
110 <dt>Icon</dt><dd><p><img src='{@href}'/></p></dd>
111 </xsl:template>
113 <xsl:template mode='dl' match='*|@*'/>
115 <xsl:template match='zi:group'>
116 <dl class='group'>
117 <xsl:apply-templates mode='attribs' select='@stability|@version|@id|@arch|@released'/>
118 <xsl:apply-templates select='zi:group|zi:requires|zi:implementation'/>
119 </dl>
120 </xsl:template>
122 <xsl:template match='zi:requires'>
123 <dt>Requires</dt>
124 <dd><a href='{@interface}'><xsl:value-of select='@interface'/></a></dd>
125 </xsl:template>
127 <xsl:template match='zi:implementation'>
128 <dl class='impl'>
129 <xsl:apply-templates mode='attribs' select='@stability|@version|@id|@arch|@released'/>
130 <xsl:apply-templates/>
131 </dl>
132 </xsl:template>
134 <xsl:template mode='attribs' match='@*'>
135 <dt><xsl:value-of select='name(.)'/></dt>
136 <dd><xsl:value-of select='.'/></dd>
137 </xsl:template>
139 <xsl:template match='zi:archive'>
140 <dt>Download</dt>
141 <dd><a href='{@href}'><xsl:value-of select='@href'/></a>
142 (<xsl:value-of select='@size'/> bytes)</dd>
143 </xsl:template>
145 </xsl:stylesheet>