diff options
author | neysx <neysx> | 2009-01-31 15:42:58 +0000 |
---|---|---|
committer | neysx <neysx> | 2009-01-31 15:42:58 +0000 |
commit | 32850f93da4e9aef0d5cd5d23bae283c71b8b91b (patch) | |
tree | 344a41d5be56c0bfe792a0ee4a6fd39b52d82217 | |
parent | Simplify DTD and use shared parts (diff) | |
download | www-redesign-32850f93da4e9aef0d5cd5d23bae283c71b8b91b.tar.gz www-redesign-32850f93da4e9aef0d5cd5d23bae283c71b8b91b.tar.bz2 www-redesign-32850f93da4e9aef0d5cd5d23bae283c71b8b91b.zip |
#257080 use same list of languages for index.xml, list.xml & overview.xml
-rw-r--r-- | xml/htdocs/xsl/guide.xsl | 48 | ||||
-rw-r--r-- | xml/htdocs/xsl/metadoc.xsl | 10 |
2 files changed, 34 insertions, 24 deletions
diff --git a/xml/htdocs/xsl/guide.xsl b/xml/htdocs/xsl/guide.xsl index eef5b89c..55096ee3 100644 --- a/xml/htdocs/xsl/guide.xsl +++ b/xml/htdocs/xsl/guide.xsl @@ -21,6 +21,7 @@ <!-- Include external stylesheets --> <xsl:include href="/xsl/content.xsl" /> <xsl:include href="/xsl/handbook.xsl" /> +<xsl:include href="/xsl/util.xsl"/> <xsl:include href="/xsl/inserts.xsl" /> <xsl:include href="/xsl/mail.xsl" /> @@ -47,6 +48,12 @@ <!-- Where is this xsl being run? --> <xsl:param name="httphost">www</xsl:param> +<xsl:variable name="basename"> + <xsl:call-template name="filename"> + <xsl:with-param name="path" select="$link"/> + </xsl:call-template> +</xsl:variable> + <!-- img tag --> <xsl:template match="img"> <img src="{@src}" alt=""/> @@ -769,8 +776,6 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found </xsl:when> <xsl:when test="title"> - <xsl:if test="not(position()=1 and title/text()=/mainpage/title)"> - <p class="chaphead"> <xsl:if test="@id"> <a name="{@id}"/> @@ -797,8 +802,6 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found </span> <xsl:value-of select="title"/> </p> - - </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="/guide"> @@ -1185,6 +1188,19 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found <xsl:template match="uri"> <xsl:param name="paramlink"/> <!-- expand templates to handle things like <uri link="http://bar"><c>foo</c></uri> --> +<xsl:variable name="theurl"> + <xsl:choose> + <xsl:when test="@link and contains(@link, '__FILE_')"> + <xsl:value-of select="concat(substring-before(@link,'__FILE__'),$basename,substring-after(@link,'__FILE__'))" /> + </xsl:when> + <xsl:when test="@link"><xsl:value-of select="@link" /></xsl:when> + <xsl:when test="contains(text(), '__FILE_')"> + <xsl:value-of select="concat(substring-before(text(),'__FILE__'),$basename,substring-after(text(),'__FILE__'))" /> + </xsl:when> + <xsl:otherwise><xsl:value-of select="text()" /></xsl:otherwise> + </xsl:choose> +</xsl:variable> + <xsl:choose> <xsl:when test="@link"> <xsl:choose> @@ -1199,10 +1215,10 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found <!-- Handbook link pointing to another part/chapter, normal case --> <xsl:choose> <xsl:when test="$style != 'printable'"> - <a href="{$link}{@link}"><xsl:apply-templates/></a> + <a href="{$link}{$theurl}"><xsl:apply-templates/></a> </xsl:when> <xsl:otherwise> - <a href="{$link}{@link}&style=printable"><xsl:apply-templates/></a> + <a href="{$link}{$theurl}&style=printable"><xsl:apply-templates/></a> </xsl:otherwise> </xsl:choose> </xsl:when> @@ -1217,9 +1233,9 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found <xsl:choose> <xsl:when test="contains(@link, 'chap=') and contains(@link, '#doc_')"> <!-- Link points inside a chapter (Case 1a)--> - <xsl:variable name="linkpart" select="substring-after(substring-before(@link, '&'), '=')" /> - <xsl:variable name="linkchap" select="substring-before(substring-after(substring-after(@link, '&'), '='), '#doc_')" /> - <xsl:variable name="linkanch" select="substring-after(@link, '#doc_')" /> + <xsl:variable name="linkpart" select="substring-after(substring-before($theurl, '&'), '=')" /> + <xsl:variable name="linkchap" select="substring-before(substring-after(substring-after($theurl, '&'), '='), '#doc_')" /> + <xsl:variable name="linkanch" select="substring-after($theurl, '#doc_')" /> <a href="#book_part{$linkpart}_chap{$linkchap}__{$linkanch}"><xsl:apply-templates /></a> </xsl:when> <xsl:when test="contains(@link, 'chap=') and contains(@link, '#')"> @@ -1230,13 +1246,13 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found </xsl:when> <xsl:when test="contains(@link, 'chap=')"> <!-- Link points to a chapter (Case 2)--> - <xsl:variable name="linkpart" select="substring-after(substring-before(@link, '&'), '=')" /> - <xsl:variable name="linkchap" select="substring-after(substring-after(@link, '&'), '=')" /> + <xsl:variable name="linkpart" select="substring-after(substring-before($theurl, '&'), '=')" /> + <xsl:variable name="linkchap" select="substring-after(substring-after($theurl, '&'), '=')" /> <a href="#book_part{$linkpart}_chap{$linkchap}"><xsl:apply-templates /></a> </xsl:when> <xsl:otherwise> <!-- Link points to a part (Case 3)--> - <xsl:variable name="linkpart" select="substring-after(@link, '=')" /> + <xsl:variable name="linkpart" select="substring-after($theurl, '=')" /> <a href="#book_part{$linkpart}"><xsl:apply-templates/></a> </xsl:otherwise> </xsl:choose> @@ -1255,17 +1271,11 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found <a href="{concat('#book_part',exslt:node-set($doc-struct)//bookpart[descendant::body[@uid=$bodyid]]/@pos,'_chap',exslt:node-set($doc-struct)//bookchap[descendant::body[@uid=$bodyid]]/@pos,'__',$locallink)}"><xsl:apply-templates /></a> </xsl:when> <xsl:otherwise> - <a href="{@link}"><xsl:apply-templates/></a> + <a href="{$theurl}"><xsl:apply-templates/></a> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> - <xsl:variable name="theurl"> - <xsl:choose> - <xsl:when test="@link"><xsl:value-of select="@link" /></xsl:when> - <xsl:otherwise><xsl:value-of select="text()" /></xsl:otherwise> - </xsl:choose> - </xsl:variable> <xsl:variable name="thelink"> <xsl:choose> diff --git a/xml/htdocs/xsl/metadoc.xsl b/xml/htdocs/xsl/metadoc.xsl index 7c438a90..bf026ebc 100644 --- a/xml/htdocs/xsl/metadoc.xsl +++ b/xml/htdocs/xsl/metadoc.xsl @@ -21,12 +21,12 @@ </xsl:if> </xsl:variable> <xsl:variable name="lang" select="exslt:node-set($metadoc)/metadoc/@lang"/> -<mainpage id="docs" lang="{$lang}" metadoc="yes"> +<mainpage lang="{$lang}" metadoc="yes"> <title><xsl:value-of select="title"/></title> <author title="Author">Gentoo Documentation Project</author> + <license/> <version>Dynamically</version> <date><xsl:value-of select="func:today()"/></date> - <license/> <xsl:if test="intro"> <chapter> @@ -75,7 +75,7 @@ </chapter> </xsl:when> <xsl:otherwise> - <xsl:apply-templates> + <xsl:apply-templates select="listing|overview"> <xsl:with-param name="metadoc" select="$metadoc"/> <xsl:with-param name="pmetadoc" select="$pmetadoc"/> <xsl:with-param name="lang" select="$lang"/> @@ -503,7 +503,7 @@ <xsl:variable name="version"> <xsl:choose> <xsl:when test="starts-with($v, '$Id:')"> - <!-- Extract version from $Id: metadoc.xsl,v 1.41 2009/01/03 18:19:14 neysx Exp $ tag --> + <!-- Extract version from $Id: metadoc.xsl,v 1.42 2009/01/31 15:42:58 neysx Exp $ tag --> <xsl:value-of select="substring-before(substring-after($v, ',v '),' ')"/> </xsl:when> <xsl:otherwise> @@ -526,7 +526,7 @@ <xsl:variable name="parentversion"> <xsl:choose> <xsl:when test="starts-with($pv, '$Id:')"> - <!-- Extract version from $Id: metadoc.xsl,v 1.41 2009/01/03 18:19:14 neysx Exp $ tag --> + <!-- Extract version from $Id: metadoc.xsl,v 1.42 2009/01/31 15:42:58 neysx Exp $ tag --> <xsl:value-of select="substring-before(substring-after($pv, ',v '),' ')"/> </xsl:when> <xsl:when test="string-length($pv)=0">?!?</xsl:when> |