diff options
author | neysx <neysx> | 2009-07-12 15:40:16 +0000 |
---|---|---|
committer | neysx <neysx> | 2009-07-12 15:40:16 +0000 |
commit | eab26cc02cef7ff201bc730c9f2c987f885f8553 (patch) | |
tree | 558bb07e9dc5fead0b558864c354cf2205edf27a /xml/htdocs | |
parent | Special for Gentoo's anniversary (diff) | |
download | www-redesign-eab26cc02cef7ff201bc730c9f2c987f885f8553.tar.gz www-redesign-eab26cc02cef7ff201bc730c9f2c987f885f8553.tar.bz2 www-redesign-eab26cc02cef7ff201bc730c9f2c987f885f8553.zip |
Show content with a file name header and grey left border when a debug.xml
exists in the document root. Should not be used on www.g.o
debug.xml should contain
<debug on="1"/>
Used an external file instead of a parameter so that it is not viewable on www.gentoo.org
Diffstat (limited to 'xml/htdocs')
-rw-r--r-- | xml/htdocs/xsl/doc-struct.xsl | 5 | ||||
-rw-r--r-- | xml/htdocs/xsl/guide.xsl | 41 | ||||
-rw-r--r-- | xml/htdocs/xsl/handbook.xsl | 10 |
3 files changed, 53 insertions, 3 deletions
diff --git a/xml/htdocs/xsl/doc-struct.xsl b/xml/htdocs/xsl/doc-struct.xsl index 0fc0727b..6c5846cb 100644 --- a/xml/htdocs/xsl/doc-struct.xsl +++ b/xml/htdocs/xsl/doc-struct.xsl @@ -20,6 +20,7 @@ <xsl:param name="doc"/> <doc-struct> <xsl:attribute name="type"><xsl:value-of select="name($doc/*[1])"/></xsl:attribute> + <file><xsl:value-of select="$link"/></file> <xsl:if test="$doc/*[1]/date"> <date><xsl:value-of select="$doc/*[1]/date"/></date> </xsl:if> @@ -36,6 +37,7 @@ <bookchap pos="{$curchap}"> <xsl:if test="$full='1' or ($curpart=$part and $curchap=$chap)"> <xsl:variable name="inc" select="document(include/@href)"/> + <file><xsl:value-of select="include/@href"/></file> <xsl:if test="$inc/sections/date"> <date><xsl:value-of select="$inc/sections/date"/></date> </xsl:if> @@ -69,6 +71,7 @@ <xsl:choose> <xsl:when test="$chapter/include"> <xsl:variable name="inc" select="document($chapter/include/@href)"/> + <file><xsl:value-of select="$chapter/include/@href"/></file> <xsl:if test="$inc//date"> <date><xsl:value-of select="$inc//date"/></date> </xsl:if> @@ -111,6 +114,7 @@ <xsl:choose> <xsl:when test="$section/include"> <xsl:variable name="inc" select="document($section/include/@href)"/> + <file><xsl:value-of select="$section/include/@href"/></file> <xsl:if test="$inc//date"> <date><xsl:value-of select="$inc//date"/></date> </xsl:if> @@ -149,6 +153,7 @@ <xsl:choose> <xsl:when test="$body/include"> <xsl:variable name="inc" select="document($body/include/@href)"/> + <file><xsl:value-of select="$body/include/@href"/></file> <xsl:if test="$inc//date"> <date><xsl:value-of select="$inc//date"/></date> </xsl:if> diff --git a/xml/htdocs/xsl/guide.xsl b/xml/htdocs/xsl/guide.xsl index 0976b5ec..0c5bcaa8 100644 --- a/xml/htdocs/xsl/guide.xsl +++ b/xml/htdocs/xsl/guide.xsl @@ -56,6 +56,11 @@ </xsl:call-template> </xsl:variable> +<!-- Debug mode, when /debug.xml exists, should never be available on www.g.o --> +<xsl:variable name="debug"> + <xsl:if test="document('/debug.xml')/debug/@on='1'">1</xsl:if> +</xsl:variable> + <!-- img tag --> <xsl:template match="img"> <img src="{@src}" alt=""/> @@ -774,7 +779,17 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found <xsl:choose> <xsl:when test="include"> - <xsl:apply-templates select="document(include/@href)//chapter"/> + <xsl:choose> + <xsl:when test="$debug='1'"> + <div style="border-left:4px solid #AAA;padding-left:4px;"> + <div style="color:white;background:#AAA;font-weight:bold;padding:4px;margin-left:-4px;"><xsl:value-of select="include/@href"/></div> + <xsl:apply-templates select="document(include/@href)//chapter"/> + </div> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="document(include/@href)//chapter"/> + </xsl:otherwise> + </xsl:choose> </xsl:when> <xsl:when test="title"> @@ -876,7 +891,17 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found <xsl:choose> <xsl:when test="include"> - <xsl:apply-templates select="document(include/@href)//section"/> + <xsl:choose> + <xsl:when test="$debug='1'"> + <div style="border-left:4px solid #888;padding-left:4px;"> + <div style="color:white;background:#888;font-weight:bold;padding:4px;margin-left:-4px;"><xsl:value-of select="include/@href"/></div> + <xsl:apply-templates select="document(include/@href)//section"/> + </div> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="document(include/@href)//section"/> + </xsl:otherwise> + </xsl:choose> </xsl:when> <xsl:when test="title"> @@ -1123,7 +1148,17 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found <xsl:if test="not(@test) or dyn:evaluate(@test)"> <xsl:choose> <xsl:when test="include"> - <xsl:apply-templates select="document(include/@href)//body"/> + <xsl:choose> + <xsl:when test="$debug='1'"> + <div style="border-left:4px solid #666;padding-left:4px;"> + <div style="color:white;background:#666;font-weight:bold;padding:4px;margin-left:-4px;"><xsl:value-of select="include/@href"/></div> + <xsl:apply-templates select="document(include/@href)//body"/> + </div> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="document(include/@href)//body"/> + </xsl:otherwise> + </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="./*[not(@test) or dyn:evaluate(@test)]"/> diff --git a/xml/htdocs/xsl/handbook.xsl b/xml/htdocs/xsl/handbook.xsl index 18022432..491070b4 100644 --- a/xml/htdocs/xsl/handbook.xsl +++ b/xml/htdocs/xsl/handbook.xsl @@ -267,6 +267,12 @@ <xsl:if test="@id"> <a name="{@id}"/> </xsl:if> + + <xsl:if test="$debug='1'"> + <xsl:text disable-output-escaping="yes"><div style="border-left:4px solid #AAA; margin-top:4px; padding-left:4px;"></xsl:text> + <div style="color:white;background:#AAA;font-weight:bold;padding:4px;margin-left:-4px;"><xsl:value-of select="include/@href"/></div> + </xsl:if> + <xsl:if test="$full = 1"> <a name="book_part{$partnum}_chap{$chapnum}"/> <h3><xsl:number level="multiple" format="1. " value="position()"/><xsl:value-of select="title" /></h3> @@ -302,6 +308,10 @@ </xsl:apply-templates> </xsl:otherwise> </xsl:choose> + + <xsl:if test="$debug='1'"> + <xsl:text disable-output-escaping="yes"></div></xsl:text> + </xsl:if> <xsl:call-template name="menubar" /> |