nicolaken 02/05/30 09:26:15
Added: src/documentation/skins/basic/xslt/html book2menu.xsl
document2html.xsl site2xhtml.xsl
Log:
Updating docs generation to Cocoon 2.0.3 used in Centipede;
cleaning the structure related to documentation.
Revision Changes Path
1.1
jakarta-avalon/src/documentation/skins/basic/xslt/html/book2menu.xsl
Index: book2menu.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name="resource"/>
<xsl:template match="book">
<menu>
<xsl:apply-templates/>
</menu>
</xsl:template>
<xsl:template match="project">
</xsl:template>
<xsl:template match="menu[position()=1]">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="menu">
<br/><b><xsl:value-of select="@label"/></b> ;
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="menu-item">- 
<xsl:if test="not(@type) or @type!='hidden'">
<xsl:choose>
<xsl:when test="@href=$resource">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:otherwise>
<a href="[EMAIL PROTECTED]"><xsl:value-of select="@label"/></a>
</xsl:otherwise>
</xsl:choose>
</xsl:if> 
</xsl:template>
<xsl:template match="external">
<xsl:if test="not(@type) or @type!='hidden'"> -
<a href="[EMAIL PROTECTED]"><xsl:value-of select="@label"/></a> ;
</xsl:if>
</xsl:template>
<xsl:template match="node()|@*" priority="-1"/>
</xsl:stylesheet>
1.1
jakarta-avalon/src/documentation/skins/basic/xslt/html/document2html.xsl
Index: document2html.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- ======================================================================
-->
<!-- document section -->
<!-- ======================================================================
-->
<xsl:template match="/">
<!-- checks if this is the included document to avoid neverending loop -->
<xsl:if test="not(book)">
<document>
<xsl:choose>
<xsl:when test="document/header/title">
<title><xsl:value-of
select="document/header/title"/></title>
</xsl:when>
<xsl:otherwise>
<title>NO TITLE</title>
</xsl:otherwise>
</xsl:choose>
<body>
<xsl:apply-templates/>
</body>
</document>
</xsl:if>
<xsl:if test="book">
<xsl:apply-templates/>
</xsl:if>
</xsl:template>
<!-- ======================================================================
-->
<!-- header section -->
<!-- ======================================================================
-->
<xsl:template match="header">
<!-- ignore on general document -->
</xsl:template>
<!-- ======================================================================
-->
<!-- body section -->
<!-- ======================================================================
-->
<xsl:template match="section">
<xsl:variable name = "level" select = "count(ancestor::section)+1" />
<xsl:choose>
<xsl:when test="$level=1">
<h2><xsl:value-of select="@title"/></h2>
<xsl:apply-templates/>
</xsl:when>
<xsl:when test="$level=2">
<h3><xsl:value-of select="@title"/></h3>
<xsl:apply-templates/>
</xsl:when>
<xsl:when test="$level=3">
<h4><xsl:value-of select="@title"/></h4>
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<h5><xsl:value-of select="@title"/></h5>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ======================================================================
-->
<!-- footer section -->
<!-- ======================================================================
-->
<xsl:template match="footer">
<!-- ignore on general documents -->
</xsl:template>
<!-- ======================================================================
-->
<!-- paragraph section -->
<!-- ======================================================================
-->
<xsl:template match="p">
<p><xsl:apply-templates/></p>
</xsl:template>
<xsl:template match="note">
<p><i><xsl:apply-templates/></i></p>
</xsl:template>
<xsl:template match="source">
<pre><xsl:apply-templates/></pre>
</xsl:template>
<xsl:template match="fixme">
<!-- ignore on documentation -->
</xsl:template>
<!-- ======================================================================
-->
<!-- list section -->
<!-- ======================================================================
-->
<xsl:template match="ul|ol|dl">
<blockquote>
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</blockquote>
</xsl:template>
<xsl:template match="li">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="sl">
<ul>
<xsl:apply-templates/>
</ul>
</xsl:template>
<xsl:template match="dt">
<li>
<strong><xsl:value-of select="."/></strong>
<xsl:text> - </xsl:text>
<xsl:apply-templates select="dd"/>
</li>
</xsl:template>
<!-- ======================================================================
-->
<!-- table section -->
<!-- ======================================================================
-->
<xsl:template match="table">
<table>
<caption><xsl:value-of select="caption"/></caption>
<xsl:apply-templates/>
</table>
</xsl:template>
<xsl:template match="tr">
<tr><xsl:apply-templates/></tr>
</xsl:template>
<xsl:template match="th">
<td colspan="[EMAIL PROTECTED]" rowspan="[EMAIL PROTECTED]">
<b><xsl:apply-templates/></b> 
</td>
</xsl:template>
<xsl:template match="td">
<td colspan="[EMAIL PROTECTED]" rowspan="[EMAIL PROTECTED]">
<xsl:apply-templates/> 
</td>
</xsl:template>
<xsl:template match="tn">
<td colspan="[EMAIL PROTECTED]" rowspan="[EMAIL PROTECTED]">
 
</td>
</xsl:template>
<xsl:template match="caption">
<!-- ignore since already used -->
</xsl:template>
<!-- ======================================================================
-->
<!-- markup section -->
<!-- ======================================================================
-->
<xsl:template match="strong">
<b><xsl:apply-templates/></b>
</xsl:template>
<xsl:template match="em">
<i><xsl:apply-templates/></i>
</xsl:template>
<xsl:template match="code">
<code><xsl:apply-templates/></code>
</xsl:template>
<!-- ======================================================================
-->
<!-- images section -->
<!-- ======================================================================
-->
<xsl:template match="figure">
<p>
<xsl:choose>
<xsl:when test="string(@width) and string(@height)">
<img src="[EMAIL PROTECTED]" alt="[EMAIL PROTECTED]" width="[EMAIL
PROTECTED]" height="[EMAIL PROTECTED]"/>
</xsl:when>
<xsl:otherwise>
<img src="[EMAIL PROTECTED]" alt="[EMAIL PROTECTED]"/>
</xsl:otherwise>
</xsl:choose>
</p>
</xsl:template>
<xsl:template match="img">
<img src="[EMAIL PROTECTED]" alt="[EMAIL PROTECTED]"/>
</xsl:template>
<xsl:template match="icon">
<img src="[EMAIL PROTECTED]" alt="[EMAIL PROTECTED]"/>
</xsl:template>
<!-- ======================================================================
-->
<!-- links section -->
<!-- ======================================================================
-->
<xsl:template match="link">
<a href="[EMAIL PROTECTED]"><xsl:apply-templates/></a>
</xsl:template>
<xsl:template match="connect">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="jump">
<a href="[EMAIL PROTECTED]@anchor}"><xsl:apply-templates/></a>
</xsl:template>
<xsl:template match="fork">
<a href="[EMAIL PROTECTED]" target="_blank"><xsl:apply-templates/></a>
</xsl:template>
<xsl:template match="anchor">
<a name="[EMAIL PROTECTED]"><xsl:comment>anchor</xsl:comment></a>
</xsl:template>
<!-- ======================================================================
-->
<!-- specials section -->
<!-- ======================================================================
-->
<xsl:template match="br">
<br/>
</xsl:template>
</xsl:stylesheet>
1.1
jakarta-avalon/src/documentation/skins/basic/xslt/html/site2xhtml.xsl
Index: site2xhtml.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="/site/document/title"/></title>
<link rel="stylesheet" type="text/css" href="skin/style.css" />
</head>
<body>
<a href="@group-logo.href@"><img src="@group-logo.src@"/></a>
<a href="@project-logo.href@"><img src="@project-logo.src@"/></a>
<h1>
<xsl:value-of select="/site/document/title"/>
</h1>
<hr/><xsl:copy-of select="/site/menu/node()|@*"/>
<hr/><xsl:copy-of select="/site/document/body/node()|@*"/>
<hr/><p><i>Copyright © @year@ @[EMAIL PROTECTED] All Rights
Reserved.</i></p>
<hr/>
<a href="http://krysalis.org/"><img
src="skin/images/krysalis-compatible.jpg" alt="Krysalis Logo"/></a>
<a href="http://xml.apache.org/cocoon/"><img
src="skin/images/built-with-cocoon.gif" alt="Cocoon Logo"/></a>
<a href="http://jakarta.apache.org/ant/"><img
src="skin/images/ant_logo_medium.gif" alt="Ant Logo"/></a>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>