[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 Arnfjörð Bjarmason <avar_at_simnet.is>
Date: 2004-02-12 16:32:20 CET

> 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

--- /home/share/software/src/subversion/tools/xslt/svnindex.css 2004-01-24 17:10:06.000000000 +0000
+++ /home/jeedo/www/projects/svn_style/svnindex.css 2004-02-12 04:48:55.000000000 +0000
@@ -1,4 +1,4 @@
-body{
+body {
   margin: 0;
   padding: 0;
 }
@@ -7,8 +7,16 @@
   color: navy;
 }
 
+ul {
+ margin: 0;
+ padding: 0;
+ list-style-type: none;
+}
+
 .footer {
+ width: 100%;
   margin-top: 8em;
+ bottom: 0;
   padding: 0.5em 1em 0.5em;
   border: 1px solid;
   border-width: 1px 0;
@@ -16,6 +24,7 @@
   border-color: rgb(30%,30%,50%) navy rgb(75%,80%,85%) navy;
   background: rgb(88%,90%,92%);
   font-size: 80%;
+ font-style: italic;
 }
 
 .svn {
@@ -24,33 +33,50 @@
 
 .rev {
   margin-right: 3px;
- padding-left: 3px;
+ margin-bottom: 0;
   text-align: left;
   font-size: 120%;
+ font-weight: normal;
+}
+
+#list {
+ padding: 0;
+ padding-top: 3px;
+ font-size: 120%;
 }
 
 .dir a {
+ display: block;
   text-decoration: none;
   color: black;
 }
 
 .file a {
+ display: block;
   text-decoration: none;
   color: black;
 }
 
-.path {
+.pathname {
+ padding-left: 3px;
   margin: 3px;
- padding: 3px;
- background: #FFCC66;
+ background: #fc6;
   font-size: 120%;
 }
 
+.updir:before {
+ content: "[ ";
+}
+
+.updir:after {
+ content: " ]";
+}
+
 .updir {
   margin: 3px;
   padding: 3px;
   margin-left: 3em;
- background: #FFEEAA;
+ background: #fea;
 }
 
 .file {
@@ -59,13 +85,19 @@
   margin-left: 3em;
   background: rgb(95%,95%,95%);
 }
+
+.file ul {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+ border: none;
+}
 
 .file:hover {
   margin: 3px;
   padding: 3px;
   margin-left: 3em;
   background: rgb(100%,100%,90%);
-/* border: 1px black solid; */
 }
 
 .dir {
@@ -74,11 +106,18 @@
   margin-left: 3em;
   background: rgb(90%,90%,90%);
 }
+
+.dir ul {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+ border: none;
+}
+
 
 .dir:hover {
   margin: 3px;
   padding: 3px;
   margin-left: 3em;
   background: rgb(100%,100%,80%);
-/* border: 1px black solid; */
 }

--- /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 04:54:49.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 16:32:51 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.