incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1180291 - in /incubator/public/trunk: build.xml site-author/stylesheets/project-menu.xsl
Date Sat, 08 Oct 2011 01:16:07 GMT
Author: sebb
Date: Sat Oct  8 01:16:06 2011
New Revision: 1180291

URL: http://svn.apache.org/viewvc?rev=1180291&view=rev
Log:
Add stylesheet to generate project-menu from podlings.xml
Generates empty temporary file currently; waiting on updated podlings.xml

Added:
    incubator/public/trunk/site-author/stylesheets/project-menu.xsl   (with props)
Modified:
    incubator/public/trunk/build.xml

Modified: incubator/public/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/public/trunk/build.xml?rev=1180291&r1=1180290&r2=1180291&view=diff
==============================================================================
--- incubator/public/trunk/build.xml (original)
+++ incubator/public/trunk/build.xml Sat Oct  8 01:16:06 2011
@@ -32,7 +32,7 @@
         </echo>
     </target>
 
-    <target name="docs" depends="prepare-error,generate-site-map" if="AnakiaTask.present">
+    <target name="docs" depends="prepare-error,generate-site-map,generate-menu" if="AnakiaTask.present">
         <taskdef name="anakia" classname="org.apache.anakia.AnakiaTask">
             <classpath refid="classpath"/>
         </taskdef>
@@ -115,7 +115,17 @@
 				templatePath='${sitemap.src}' 
 				outputFile='../${sitemap.work}/generation.report' />
 	</target>
-	
+
+    <!-- Generate the menu file entity from podlings.xml -->
+    <!-- TODO: change out to .ent rather than .tmp once podlings.xml is in use -->
+    <target name="generate-menu">
+        <xslt
+            in="${docs.src}/podlings.xml"
+            out='${docs.src}/stylesheets/project-menu.tmp' 
+            style='${docs.src}/stylesheets/project-menu.xsl'>
+        </xslt>
+    </target>
+
 	<!--
 Audit Tasks
 ===========

Added: incubator/public/trunk/site-author/stylesheets/project-menu.xsl
URL: http://svn.apache.org/viewvc/incubator/public/trunk/site-author/stylesheets/project-menu.xsl?rev=1180291&view=auto
==============================================================================
--- incubator/public/trunk/site-author/stylesheets/project-menu.xsl (added)
+++ incubator/public/trunk/site-author/stylesheets/project-menu.xsl Sat Oct  8 01:16:06 2011
@@ -0,0 +1,54 @@
+<?xml version='1.0'?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License. 
+-->
+
+<!-- 
+   Process podlings.xml to produce site-author/stylesheets/project-menu.ent from current
entries.
+
+   Assumes the format is:
+   
+   <podling name='Name' status='current' resource='name'>
+
+ -->
+<xsl:stylesheet 
+            xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
+            version='1.0'>
+    <xsl:output 
+            method='html' 
+            indent='no'
+            encoding='UTF-8'/>
+            
+    <xsl:template match='podlings'>
+        <xsl:apply-templates select="podling[@status = 'current']">
+            <xsl:sort select='@name'/>
+        </xsl:apply-templates>
+    </xsl:template>
+    <xsl:template match='podling'>
+      <!-- copy original spacing (could be removed) -->
+      <xsl:text>      </xsl:text>
+        <li><xsl:element name='a'>
+                <xsl:attribute name='href'><xsl:value-of select="concat('/projects/',
@resource, '.html')"/></xsl:attribute>
+                <xsl:value-of select='@name'/>
+            </xsl:element>
+        </li>
+<!-- Add EOL after each entry -->
+<xsl:text>
+</xsl:text>
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file

Propchange: incubator/public/trunk/site-author/stylesheets/project-menu.xsl
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message