diff options
Diffstat (limited to 'gentoobrowse/xslt/use.xslt')
-rw-r--r-- | gentoobrowse/xslt/use.xslt | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/gentoobrowse/xslt/use.xslt b/gentoobrowse/xslt/use.xslt index 4fecc13..e8c5ea8 100644 --- a/gentoobrowse/xslt/use.xslt +++ b/gentoobrowse/xslt/use.xslt @@ -1,55 +1,57 @@ <?xml version="1.0" encoding="UTF-8" ?> -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:project2="http://project2.randomdan.homeip.net" exclude-result-prefixes="project2" > +<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" /> <xsl:template name="head"> - <title>Packages with the <xsl:value-of select="/gentoo/project2:uriElems/uriElem[2]" /> USE flag · Gentoo Browse</title> - <meta name="description"> - <xsl:attribute name="content">Packages with the <xsl:value-of select="/gentoo/project2:uriElems/uriElem[2]" /> USE flag</xsl:attribute> - </meta> + <title>Use flag index · Gentoo Browse</title> + <meta name="description">Use flag index</meta> </xsl:template> <xsl:template name="header"> - <h1> - Packages with the - <xsl:call-template name="split"> - <xsl:with-param name="pText" select="/gentoo/project2:uriElems/uriElem[2]" /> - <xsl:with-param name="pBy" select="'_'" /> - </xsl:call-template> - USE flag - </h1> - <xsl:if test="/gentoo/global/use"> - <p class="lead">Global definition: <xsl:value-of select="/gentoo/global/use/description" />.</p> - </xsl:if> + <h1>Use flag index</h1> </xsl:template> <xsl:template name="content"> - <xsl:apply-templates select="/gentoo/packages" /> + <xsl:apply-templates select="/gentoo/uses" /> </xsl:template> - <xsl:template match="/gentoo/packages"> + <xsl:template match="/gentoo/uses"> + <xsl:variable name="firsts" select="use[substring(use, 1, 1) != substring(preceding-sibling::use[1]/use, 1, 1)]" /> <div class="span3 bs-docs-sidebar"> <ul class="nav nav-list bs-docs-sidenav"> - <xsl:for-each select="categories/value"> + <xsl:for-each select="$firsts"> + <xsl:variable name="char" select="substring(use, 1, 1)" /> <li> <a> - <xsl:attribute name="href">#<xsl:value-of select="." /></xsl:attribute> - <i class="icon-chevron-right"></i> <xsl:value-of select="." /> + <xsl:attribute name="href">#<xsl:value-of select="$char" /></xsl:attribute> + <i class="icon-chevron-right"></i> <xsl:value-of select="$char" /> </a> </li> </xsl:for-each> </ul> </div> <div class="span9"> - <xsl:for-each select="categories/value"> + <xsl:for-each select="$firsts"> + <xsl:variable name="char" select="substring(use, 1, 1)" /> <section> - <xsl:attribute name="id"><xsl:value-of select="." /></xsl:attribute> + <xsl:attribute name="id"><xsl:value-of select="$char" /></xsl:attribute> <h2 class="page-header"> - <xsl:value-of select="." /> + <xsl:value-of select="$char" /> </h2> - <xsl:apply-templates select="/gentoo/packages/package[catname = current()/.]" /> + <dl class="dl-horizontal"> + <xsl:for-each select="../use[substring(use, 1, 1) = $char]"> + <dt> + <a> + <xsl:attribute name="href">/use/<xsl:value-of select="use" /></xsl:attribute> + <xsl:value-of select="use" /> + </a> + </dt> + <dd> + <xsl:value-of select="description" /> + </dd> + </xsl:for-each> + </dl> </section> </xsl:for-each> </div> |