[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] tools/xslt/svnindex.xsl and tools/xslt/svnindex.css

From: var Arnfjr Bjarmason <avar_at_simnet.is>
Date: 2004-02-12 21:23:17 CET

var Arnfjr Bjarmason wrote:
>> I've sent this one in before, however it seems some people
>> mi-understood its purpise, i was pointed to this article:
>> http://a.mongers.org/clueful/1999-phk-bikeshed becouse people just
>> thought i re-formatted the XML output to my liking.
>>
>> Thats not what this is, The reason i modified this file is that its
>> hard to apply a style to it that doesnt look like the original one,
>> this re-formats the XML output, but not just for the sake of
>> re-formatting, its all done to make it easier to apply CSS styles to
>> the document. Particularly it now generates more correct <ul>+<li>
>> that are properly nested, having the nice side-affect of it looking
>> even better if there exists no stylesheet at all.
>>
>> I do hope somone applies this unlike the old one because it will make
>> it a lot easier to make a "cute" index page (belive me, i tried) and
>> since thats the main function of this document that makes this a
>> pretty important patch;)
>>
>> Also, im sending in a patch to the provided css document, this makes
>> it look just like the original one but was changed because of
>> subsiquent changes in the XSL doc.
>>
>> Again, this is not just a XSL reformat, rest assured that if i just
>> didnt like the coding style i would be sending in something generated
>> by a for-loop containing 'indent' ;)
>
>
> It was pointed out to me that the patch was kinda crappy regarding
> indent , so i fixed that, use this instead.
> Oh, and one minor css error fixed
>

Got a pointer from Jonathan (the great mailing list lurker) that my indend was
still a bit off, here is one last fix for that.

--- /home/share/software/src/subversion/tools/xslt/svnindex.xsl 2004-01-24 17:10:06.000000000 +0000
+++ /home/jeedo/www/projects/svn_style/svnindex.xsl 2004-02-12 20:22:33.000000000 +0000
@@ -15,13 +15,13 @@
           </xsl:if>
           <xsl:value-of select="index/@path"/>
         </title>
- <link rel="stylesheet" type="text/css" href="/svnindex.css"/>
+ <link rel="stylesheet" type="text/css" href="/projects/svn_style/svnindex.css"/>
       </head>
       <body>
         <div class="svn">
           <xsl:apply-templates/>
         </div>
- <div class="footer">
+ <address class="footer">
           <xsl:text>Powered by </xsl:text>
           <xsl:element name="a">
             <xsl:attribute name="href">
@@ -31,13 +31,13 @@
           </xsl:element>
           <xsl:text> </xsl:text>
           <xsl:value-of select="@version"/>
- </div>
+ </address>
       </body>
     </html>
   </xsl:template>
 
   <xsl:template match="index">
- <div class="rev">
+ <h1 class="rev">
       <xsl:if test="string-length(@name) != 0">
         <xsl:value-of select="@name"/>
         <xsl:if test="string-length(@rev) != 0">
@@ -48,29 +48,30 @@
         <xsl:text>Revision </xsl:text>
         <xsl:value-of select="@rev"/>
       </xsl:if>
- </div>
- <div class="path">
- <xsl:value-of select="@path"/>
- </div>
- <xsl:apply-templates select="updir"/>
- <xsl:apply-templates select="dir"/>
- <xsl:apply-templates select="file"/>
+ </h1>
+ <ul id="list">
+ <li>
+ <div class="pathname"><xsl:value-of select="@path"/></div>
+ <ul>
+ <xsl:apply-templates select="updir"/>
+ <xsl:apply-templates select="dir"/>
+ <xsl:apply-templates select="file"/>
+ </ul>
+ </li>
+ </ul>
   </xsl:template>
 
   <xsl:template match="updir">
- <div class="updir">
- <xsl:text>[</xsl:text>
+ <li class="updir">
       <xsl:element name="a">
         <xsl:attribute name="href">..</xsl:attribute>
- <xsl:text>Parent Directory</xsl:text>
+ <xsl:text>..</xsl:text>
       </xsl:element>
- <xsl:text>]</xsl:text>
- </div>
- <!-- xsl:apply-templates/ -->
+ </li>
   </xsl:template>
 
   <xsl:template match="dir">
- <div class="dir">
+ <li class="dir">
       <xsl:element name="a">
         <xsl:attribute name="href">
           <xsl:value-of select="@href"/>
@@ -78,20 +79,18 @@
         <xsl:value-of select="@name"/>
         <xsl:text>/</xsl:text>
       </xsl:element>
- </div>
- <!-- <xsl:apply-templates/ -->
+ </li>
   </xsl:template>
 
   <xsl:template match="file">
- <div class="file">
+ <li class="file">
       <xsl:element name="a">
         <xsl:attribute name="href">
           <xsl:value-of select="@href"/>
         </xsl:attribute>
         <xsl:value-of select="@name"/>
       </xsl:element>
- </div>
- <!-- xsl:apply-templates/ -->
+ </li>
   </xsl:template>
 
 </xsl:stylesheet>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Feb 12 21:23:55 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.