Warn about tar archives with a leading "./" in the name.
[0publish-gui.git] / interface.xsl
blob64c5c3ec40a31f27cccb139f12603ecabbbe6f9a
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 add this program to your Applications menu, choose
45 <b>Zero Install -> Add New Program</b> from the <b>Applications</b> menu. e.g. on Ubuntu:</p>
46 <p style='text-align: center'>
47 <img width="335" height="259" src="http://0install.net/tutorial/add-with-gnome.png" alt='Adding with GNOME'/>
48 </p>
49 <p>If you don't see this menu item, install the <b>zeroinstall-injector</b> package from your
50 distribution's repository, or from <a href='http://0install.net/injector.html'>0install.net</a>.</p>
52 <p>
53 Drag <a href='{/zi:interface/@uri}'>the feed's URL</a> to the dialog box that appears.
54 Other environments may use other systems. For example, if you are a ROX desktop user, drag
55 the link to <a href='http://rox.sourceforge.net/desktop/AddApp'>AddApp</a> instead.
56 </p>
58 <p>Alternatively, to run it from the command-line:</p>
59 <pre>$ 0launch <xsl:value-of select='/zi:interface/@uri'/></pre>
60 <p>
61 The <b>0alias</b> command can be used to create a short-cut to run it again later.
62 </p>
63 <p>
64 If you don't have the <b>0launch</b> command, download it from
65 <a href='http://0install.net/injector.html'>the 0install.net web-site</a>, which also contains
66 documentation about how the Zero Install system works.</p>
67 </xsl:when>
68 <xsl:otherwise>
69 <p>This is a Zero Install feed.
70 This software cannot be run as an application directly. It is a library for other programs to use.</p>
71 <p>For more information about Zero Install, see <a href='http://0install.net'>0install.net</a>.</p>
72 </xsl:otherwise>
73 </xsl:choose>
74 </dd>
76 <xsl:apply-templates mode='dl' select='*|@*'/>
78 <dt>Available versions</dt>
79 <dd>
80 <xsl:choose>
81 <xsl:when test='//zi:implementation'>
82 <p>The list below is just for information; Zero Install will automatically download one of
83 these versions for you.
84 </p>
85 <table>
86 <tr><th>Version</th><th>Released</th><th>Stability</th><th>Platform</th><th>Download</th></tr>
87 <xsl:for-each select='//zi:implementation'>
88 <tr>
89 <td><xsl:value-of select='(ancestor-or-self::*[@version])[last()]/@version'/>
90 <xsl:if test='(ancestor-or-self::*[@version])[last()]/@version-modifier'><xsl:value-of select='(ancestor-or-self::*[@version])[last()]/@version-modifier'/></xsl:if>
91 <xsl:if test='@langs'>
92 (<xsl:value-of select='@langs'/>)
93 </xsl:if>
94 </td>
95 <td><xsl:value-of select='(ancestor-or-self::*[@released])[last()]/@released'/></td>
96 <td><xsl:value-of select='(ancestor-or-self::*[@stability])[last()]/@stability'/></td>
97 <td>
98 <xsl:variable name='arch' select='(ancestor-or-self::*[@arch])[last()]/@arch'/>
99 <xsl:choose>
100 <xsl:when test='$arch = "*-src"'>Source code</xsl:when>
101 <xsl:when test='not($arch)'>Any</xsl:when>
102 <xsl:otherwise><xsl:value-of select='$arch'/></xsl:otherwise>
103 </xsl:choose>
104 </td>
105 <td>
106 <xsl:for-each select='.//zi:archive'>
107 <a href='{@href}'>Download</a> (<xsl:value-of select='@size'/> bytes)
108 </xsl:for-each>
109 </td>
110 </tr>
111 </xsl:for-each>
112 </table>
113 </xsl:when>
114 <xsl:otherwise>
115 <p>No versions are available for downlad.</p>
116 </xsl:otherwise>
117 </xsl:choose>
118 </dd>
120 <dt>Required libraries</dt>
121 <dd>
122 <xsl:choose>
123 <xsl:when test='//zi:requires'>
124 <p>The list below is just for information; Zero Install will automatically download any required
125 libraries for you.
126 </p>
127 <ul>
128 <xsl:for-each select='//zi:requires'>
129 <xsl:variable name='interface' select='@interface'/>
130 <xsl:if test='not(preceding::zi:requires[@interface = $interface])'>
131 <li><a><xsl:attribute name='href'><xsl:value-of select='$interface'/></xsl:attribute><xsl:value-of select='$interface'/></a></li>
132 </xsl:if>
133 </xsl:for-each>
134 </ul>
135 </xsl:when>
136 <xsl:otherwise>
137 <p>This feed does not list any additional requirements.</p>
138 </xsl:otherwise>
139 </xsl:choose>
140 </dd>
141 </dl>
142 </div>
143 </body>
144 </html>
145 </xsl:template>
147 <xsl:template mode='dl' match='/zi:interface/@uri'>
148 <dt>Full name</dt><dd><p><a href='{.}'><xsl:value-of select="."/></a></p></dd>
149 </xsl:template>
151 <xsl:template mode='dl' match='zi:homepage'>
152 <dt>Homepage</dt><dd><p><a href='{.}'><xsl:value-of select="."/></a></p></dd>
153 </xsl:template>
155 <xsl:template mode='dl' match='zi:description'>
156 <xsl:if test="not(@xml:lang)">
157 <dt>Description</dt><dd><p><xsl:value-of select="."/></p></dd>
158 </xsl:if>
159 </xsl:template>
161 <xsl:template mode='dl' match='zi:icon'>
162 <dt>Icon</dt><dd><p><img src='{@href}'/></p></dd>
163 </xsl:template>
165 <xsl:template mode='dl' match='*|@*'/>
167 <xsl:template match='zi:group'>
168 <dl class='group'>
169 <xsl:apply-templates mode='attribs' select='@stability|@version|@id|@arch|@released'/>
170 <xsl:apply-templates select='zi:group|zi:requires|zi:implementation'/>
171 </dl>
172 </xsl:template>
174 <xsl:template match='zi:requires'>
175 <dt>Requires</dt>
176 <dd><a href='{@interface}'><xsl:value-of select='@interface'/></a></dd>
177 </xsl:template>
179 <xsl:template match='zi:implementation'>
180 <dl class='impl'>
181 <xsl:apply-templates mode='attribs' select='@stability|@version|@id|@arch|@released'/>
182 <xsl:apply-templates/>
183 </dl>
184 </xsl:template>
186 <xsl:template mode='attribs' match='@*'>
187 <dt><xsl:value-of select='name(.)'/></dt>
188 <dd><xsl:value-of select='.'/></dd>
189 </xsl:template>
191 <xsl:template match='zi:archive'>
192 <dt>Download</dt>
193 <dd><a href='{@href}'><xsl:value-of select='@href'/></a>
194 (<xsl:value-of select='@size'/> bytes)</dd>
195 </xsl:template>
197 </xsl:stylesheet>