This is now xhtml 1.0 strict. Also changed the layout. I think it looks much better now. Firefox still cannot handle the xsl -> xhtml transition so I will probably change this back to html if I cannot figure it out.

This commit is contained in:
Steve Checkoway
2007-08-06 05:12:50 +00:00
parent 8c1baf71ee
commit a56b120755
+76 -33
View File
@@ -9,24 +9,34 @@
doctype-system="http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" />
-->
<xsl:output method="html" encoding="UTF-8" version="4.01" standalone="yes"
<!--<xsl:output method="html" encoding="UTF-8" version="4.01" standalone="yes"
doctype-system="http://www.w3.org/TR/html4/strict.dtd"
doctype-public="-//W3C//DTD HTML 4.01//EN" />
doctype-public="-//W3C//DTD HTML 4.01//EN" />-->
<xsl:output method="xml" encoding="UTF-8" version="1.0"
doctype-system="http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
media-type="application/xhtml+xml"
indent="yes"/>
<xsl:template match="/">
<html>
<head>
<title>StepMania LUA Information</title>
<style type="text/css">
th {
background-color: #FAEBD7;
border: 1px solid
background-color: #CCCCFF;
border-style: solid;
border-width: thin;
padding: 2px;
font-size: 150%
}
table {
border: 1px solid
border-style: ridge;
border-collapse: collapse
}
td {
border: 1px solid
padding: 2px;
border-style: solid;
border-width: thin
}
hr {
width: 90%
@@ -37,6 +47,26 @@
.code {
font-family: monospace
}
.returnTypeCell {
font-family: monospace;
text-align: right;
vertical-align: text-top;
width: 10em
}
.descriptionCell {
font-family: monospace;
text-align: justify;
vertical-align: text-top
}
.descriptionName {
font-family: monospace;
font-weight: bold
}
.descriptionText {
text-indent: 2em;
margin-top: 0;
margin-bottom: 0
}
.trigger {
cursor: pointer
}
@@ -146,17 +176,17 @@
<div>
<a id="{@name}" class="trigger" onclick="Toggle('{@name}')">
<img src="closed.gif" id="img_{@name}" alt="" />
Class <text class="code"><xsl:value-of select="@name" /></text>
Class <span class="descriptionName"><xsl:value-of select="@name" /></span>
</a>
<xsl:if test="@base != ''">
<text class="code"><xsl:text> : </xsl:text></text>
<span class="code"><xsl:text> : </xsl:text></span>
<a class="code" href="#{@base}" onclick="Open('{@base}')">
<xsl:value-of select="@base" />
</a>
</xsl:if>
<div style="display: none" id="list_{@name}">
<table>
<tr><th>Function</th><th>Description</th></tr>
<tr><th colspan="2">Member Functions</th></tr>
<xsl:apply-templates select="sm:Function">
<xsl:sort select="@name" />
<xsl:with-param name="path" select="$docs/sm:Classes/sm:Class[@name=$name]" />
@@ -173,7 +203,7 @@
<div>
<h3 id="GlobalFunctions">Global Functions</h3>
<table>
<tr><th>Function</th><th>Description</th></tr>
<tr><th colspan="2">Functions</th></tr>
<xsl:apply-templates select="sm:Function">
<xsl:sort select="@name" />
<xsl:with-param name="path" select="$docs/sm:GlobalFunctions" />
@@ -190,27 +220,40 @@
<xsl:variable name="name" select="@name" />
<xsl:variable name="elmt" select="$path/sm:Function[@name=$name]" />
<tr id="{$class}_{$name}">
<xsl:choose>
<xsl:when test="string($elmt/@name)=$name"><td class="code"> <!-- The name must exist. -->
<xsl:choose>
<!-- XXX: /Lua/Classes/sm:Class[@name=$elmt/@return] does not work and I have no idea why. -->
<xsl:when test="boolean(//sm:Class[@name=$elmt/@return])">
<a href="#{$elmt/@return}" onclick="Open('{$elmt/@return}')"><xsl:value-of select="$elmt/@return" /></a>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<!-- Check for documentation. -->
<xsl:when test="string($elmt/@name)=$name">
<td class="returnTypeCell">
<xsl:choose>
<!-- XXX: /Lua/Classes/sm:Class[@name=$elmt/@return]
does not work and I have no idea why. -->
<xsl:when test="boolean(//sm:Class[@name=$elmt/@return])">
<a href="#{$elmt/@return}"
onclick="Open('{$elmt/@return}')">
<xsl:value-of select="$elmt/@return" />
</xsl:otherwise>
</xsl:choose>
<xsl:text> </xsl:text>
<xsl:value-of select="@name" />( <xsl:value-of select="$elmt/@arguments" /> )
</td><td><xsl:apply-templates select="$elmt" mode="print">
<xsl:with-param name="class" select="$class" />
</xsl:apply-templates></td>
</xsl:when>
<xsl:otherwise>
<td class="code"><xsl:value-of select="@name" /></td>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$elmt/@return" />
</xsl:otherwise>
</xsl:choose>
</td>
<td class="descriptionCell">
<span class="descriptionName"><xsl:value-of select="@name" /></span>( <xsl:value-of select="$elmt/@arguments" /> )
<p class="descriptionText">
<xsl:apply-templates select="$elmt" mode="print">
<xsl:with-param name="class" select="$class" />
</xsl:apply-templates>
</p>
</td>
</xsl:when>
<xsl:otherwise>
<td class="returnTypeCell" />
<td class="descriptionCell">
<span class="descriptionName"><xsl:value-of select="@name" /></span>
</td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:template>
<xsl:template match="sm:Function" mode="print">
@@ -255,7 +298,7 @@
<div id="ENUM_{@name}">
<a class="trigger" onclick="Toggle('{@name}')">
<img src="closed.gif" id="img_{@name}" alt="" />
Enum <text class="code"><xsl:value-of select="@name" /></text></a>
Enum <span class="descriptionName"><xsl:value-of select="@name" /></span></a>
<div style="display: none" id="list_{@name}">
<table>
<tr>
@@ -298,6 +341,6 @@
<!-- XXX: This is annoying, how can we tell xsl to just pass the html through? -->
<xsl:template match="sm:code">
<xsl:copy><xsl:apply-templates /></xsl:copy>
<code><xsl:apply-templates /></code>
</xsl:template>
</xsl:stylesheet>