diff options
Diffstat (limited to 'gentoobrowse/browse.xslt')
-rw-r--r-- | gentoobrowse/browse.xslt | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/gentoobrowse/browse.xslt b/gentoobrowse/browse.xslt new file mode 100644 index 0000000..c62e886 --- /dev/null +++ b/gentoobrowse/browse.xslt @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:import href="base.xslt" /> + <xsl:output encoding="utf-8" method="html" media-type="text/html" indent="yes" + doctype-system="http://www.w3.org/TR/html4/loose.dtd" + doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" /> + <xsl:template name="content"> + <xsl:apply-templates select="/gentoo/categories" /> + <xsl:apply-templates select="/gentoo/packages" /> + <xsl:apply-templates select="/gentoo/summary/package" /> + </xsl:template> + <xsl:template match="/gentoo/categories"> + <h2>Package groups</h2> + <table class="grps"> + <tr> + <th>Category</th> + <th>Packages</th> + </tr> + <xsl:apply-templates select="/gentoo/categories/category" /> + </table> + </xsl:template> + <xsl:template match="/gentoo/categories/category"> + <tr> + <td> + <a> + <xsl:attribute name="href"> + /category/<xsl:value-of select="catname" /> + </xsl:attribute> + <xsl:value-of select="catname" /> + </a> + </td> + <td> + <xsl:value-of select="packages" /> + </td> + </tr> + </xsl:template> + <xsl:template match="/gentoo/packages"> + <h2>Packages</h2> + <ul> + <xsl:apply-templates select="/gentoo/packages/package" /> + </ul> + </xsl:template> + <xsl:template match="/gentoo/summary/package/versions"> + <table class="versions"> + <xsl:apply-templates select="version" /> + </table> + </xsl:template> + <xsl:template match="/gentoo/summary/package/versions/version"> + <tr class="row1"> + <td class="ver"> + v<xsl:value-of select="version" /> + </td> + <td class="archs"> + <xsl:apply-templates select="../../versionArchs/arch[ebuildid=current()/ebuildid]"> + <xsl:sort select="arch" /> + </xsl:apply-templates> + </td> + </tr> + <tr class="row2"> + <td colspan="2" class="use"> + Use flags: + <xsl:apply-templates select="../../versionUses/use[ebuildid=current()/ebuildid]"> + <xsl:sort select="use" /> + </xsl:apply-templates> + </td> + </tr> + </xsl:template> + <xsl:template match="/gentoo/summary/package"> + <h2> + <a> + <xsl:attribute name="href"> + /category/<xsl:value-of select="catname" /> + </xsl:attribute> + <xsl:value-of select="catname" /> + </a>/<xsl:value-of select="pkgname" /> + </h2> + <p> + <xsl:value-of select="description" /> + </p> + <xsl:apply-templates select="packageUrls" /> + <xsl:apply-templates select="versions" /> + <xsl:apply-templates select="deps" /> + </xsl:template> + <xsl:template match="/gentoo/summary/package/packageUrls"> + <ul> + <xsl:apply-templates match="url" /> + </ul> + </xsl:template> + <xsl:template match="/gentoo/summary/package/packageUrls/url"> + <a target="_blank"> + <xsl:attribute name="href"> + <xsl:value-of select="url" /> + </xsl:attribute> + <xsl:value-of select="url" /> + </a> + </xsl:template> + <xsl:template match="/gentoo/summary/package/versionUses/use"> + <xsl:value-of select="use" /> + <xsl:text> </xsl:text> + </xsl:template> + <xsl:template match="/gentoo/summary/package/versionArchs/arch"> + <xsl:value-of select="arch" /> + <xsl:text> </xsl:text> + </xsl:template> + <xsl:template match="/gentoo/summary/package/deps"> + <h3>Dependencies</h3> + <ul> + <xsl:apply-templates match="/gentoo/summary/package/deps/package" /> + </ul> + </xsl:template> +</xsl:stylesheet> |