Add a Namespaces element and update the xsl and the documentation to match.
This commit is contained in:
+21
-8
@@ -9,6 +9,7 @@
|
||||
<xs:all>
|
||||
<xs:element name="Singletons" type="Singletons" />
|
||||
<xs:element name="Classes" type="Classes" />
|
||||
<xs:element name="Namespaces" type="Namespaces" />
|
||||
<xs:element name="GlobalFunctions" type="GlobalFunctions" />
|
||||
<xs:element name="Enums" type="Enums" />
|
||||
<xs:element name="Constants" type="Constants" />
|
||||
@@ -23,6 +24,7 @@
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="Classes" type="Classes" />
|
||||
<xs:element name="Namespaces" type="Namespaces" />
|
||||
<xs:element name="GlobalFunctions" type="GlobalFunctions" />
|
||||
<xs:element name="Enums" type="Enums" />
|
||||
</xs:all>
|
||||
@@ -43,12 +45,6 @@
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="FunctionIdentifier">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z_][a-zA-Z0-9_]*)?" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="IdentifierOrTable">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="[a-zA-Z_][a-zA-Z0-9_]*|\{[a-zA-Z_][a-zA-Z0-9_]*\}" />
|
||||
@@ -119,6 +115,22 @@
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="Namespaces">
|
||||
<xs:sequence>
|
||||
<xs:element name="Namespace" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="Description" type="Description"
|
||||
minOccurs="0" maxOccurs="1" />
|
||||
<xs:element name="Function" type="Function"
|
||||
minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="Identifier" use="required" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
|
||||
<xs:complexType name="GlobalFunctions">
|
||||
<xs:sequence>
|
||||
@@ -129,14 +141,14 @@
|
||||
|
||||
<xs:complexType name="Function" mixed="true">
|
||||
<xs:group ref="DocumentationGroup" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:attribute name="name" type="FunctionIdentifier" use="required" />
|
||||
<xs:attribute name="name" type="Identifier" use="required" />
|
||||
<xs:attribute name="return" type="IdentifierOrTable" use="optional" />
|
||||
<xs:attribute name="arguments" type="ArgumentList" use="optional" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="Link" mixed="true">
|
||||
<xs:group ref="DocumentationGroup" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:attribute name="function" type="FunctionIdentifier" use="optional" />
|
||||
<xs:attribute name="function" type="Identifier" use="optional" />
|
||||
<xs:attribute name="class" type="Identifier" use="optional" />
|
||||
</xs:complexType>
|
||||
|
||||
@@ -170,3 +182,4 @@
|
||||
<xs:attribute name="value" type="IdentifierStringOrNumber" use="required" />
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
<!-- vim: set tw=0: -->
|
||||
|
||||
+54
-3
@@ -151,6 +151,7 @@
|
||||
<tr>
|
||||
<th><a href="#Singletons">Singletons</a></th>
|
||||
<th><a href="#Classes">Classes</a></th>
|
||||
<th><a href="#Namespaces">Namespaces</a></th>
|
||||
<th><a href="#GlobalFunctions">Global Functions</a></th>
|
||||
<th><a href="#Enums">Enums</a></th>
|
||||
<th><a href="#Constants">Constants</a></th>
|
||||
@@ -159,6 +160,7 @@
|
||||
</div>
|
||||
<xsl:apply-templates select="sm:Singletons" />
|
||||
<xsl:apply-templates select="sm:Classes" />
|
||||
<xsl:apply-templates select="sm:Namespaces" />
|
||||
<xsl:apply-templates select="sm:GlobalFunctions" />
|
||||
<xsl:apply-templates select="sm:Enums" />
|
||||
<xsl:apply-templates select="sm:Constants" />
|
||||
@@ -196,6 +198,15 @@
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sm:Namespaces">
|
||||
<div>
|
||||
<h3 id="Namespaces">Namespaces</h3>
|
||||
<xsl:apply-templates select="sm:Namespace">
|
||||
<xsl:sort select="@name" />
|
||||
</xsl:apply-templates>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:variable name="docs" select="document('LuaDocumentation.xml')/sm:Documentation" />
|
||||
|
||||
<xsl:template match="sm:Class">
|
||||
@@ -226,6 +237,27 @@
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sm:Namespace">
|
||||
<xsl:variable name="name" select="@name" />
|
||||
<div>
|
||||
<a id="{@name}" class="trigger" onclick="Toggle('{@name}')">
|
||||
<img src="closed.gif" id="img_{@name}" alt="" />
|
||||
Namespace <span class="descriptionName"><xsl:value-of select="@name" /></span>
|
||||
</a>
|
||||
<div style="display: none" id="list_{@name}">
|
||||
<xsl:apply-templates select="$docs/sm:Namespaces/sm:Namespace[@name=$name]/sm:Description" />
|
||||
<table>
|
||||
<tr><th colspan="2"><xsl:value-of select="$name" /> Functions</th></tr>
|
||||
<xsl:apply-templates select="sm:Function">
|
||||
<xsl:sort select="@name" />
|
||||
<xsl:with-param name="path" select="$docs/sm:Namespaces/sm:Namespace[@name=$name]" />
|
||||
<xsl:with-param name="class" select="$name" />
|
||||
</xsl:apply-templates>
|
||||
</table>
|
||||
<br />
|
||||
</div>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sm:GlobalFunctions">
|
||||
<div>
|
||||
@@ -368,14 +400,19 @@
|
||||
<xsl:param name="curclass" />
|
||||
<xsl:variable name="empty" select="string(current())=''" />
|
||||
<xsl:choose>
|
||||
<!-- Linking to a function in the current class/namespace. -->
|
||||
<xsl:when test="string(@class)='' and string(@function)!=''">
|
||||
<a class="classType" href="#{$curclass}_{@function}">
|
||||
<xsl:if test="$empty">
|
||||
<xsl:value-of select="@function" /><xsl:text>()</xsl:text>
|
||||
<xsl:call-template name="sm:PrintLink">
|
||||
<xsl:with-param name="class" select="$curclass" />
|
||||
<xsl:with-param name="function" select="@function" />
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates />
|
||||
</a>
|
||||
</xsl:when>
|
||||
<!-- Linking to a class/namespace. -->
|
||||
<xsl:when test="string(@class)!='' and string(@function)=''">
|
||||
<a class="classType" href="#{@class}" onclick="Open('{@class}')">
|
||||
<xsl:if test="$empty">
|
||||
@@ -384,6 +421,7 @@
|
||||
<xsl:apply-templates />
|
||||
</a>
|
||||
</xsl:when>
|
||||
<!-- Linking to a global function or an enum. -->
|
||||
<xsl:when test="(string(@class)='GLOBAL' or string(@class)='ENUM') and string(@function)!=''">
|
||||
<a class="classType" href="#{@class}_{@function}" onclick="Open('{@function}')">
|
||||
<xsl:if test="$empty">
|
||||
@@ -395,11 +433,14 @@
|
||||
<xsl:apply-templates />
|
||||
</a>
|
||||
</xsl:when>
|
||||
<!-- Linking to a function in a class/namespace. -->
|
||||
<xsl:when test="string(@class)!='' and string(@function)!=''">
|
||||
<a class="classType" href="#{@class}_{@function}" onclick="OpenAndMove('{@class}','{@function}')">
|
||||
<xsl:if test="$empty">
|
||||
<xsl:value-of select="@class" /><xsl:text>:</xsl:text>
|
||||
<xsl:value-of select="@function" /><xsl:text>()</xsl:text>
|
||||
<xsl:call-template name="sm:PrintLink">
|
||||
<xsl:with-param name="class" select="@class" />
|
||||
<xsl:with-param name="function" select="@function" />
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates />
|
||||
</a>
|
||||
@@ -410,6 +451,15 @@
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="sm:PrintLink">
|
||||
<xsl:param name="class" />
|
||||
<xsl:param name="function" />
|
||||
<xsl:value-of select="$class" />
|
||||
<xsl:text>.</xsl:text>
|
||||
<xsl:value-of select="$function" />
|
||||
<xsl:text>()</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sm:Enums">
|
||||
<div>
|
||||
<h3 id="Enums">Enums</h3>
|
||||
@@ -474,3 +524,4 @@
|
||||
<xsl:template match="sm:code"><code><xsl:apply-templates /></code></xsl:template>
|
||||
<xsl:template match="sm:br"><br /></xsl:template>
|
||||
</xsl:stylesheet>
|
||||
<!-- vim: set tw=0: -->
|
||||
|
||||
@@ -32,9 +32,6 @@
|
||||
<Function name='DayOfYear' return='int' arguments=''>
|
||||
Returns the current day of the year.
|
||||
</Function>
|
||||
<Function name='Enum.Reverse' return='int' arguments=''>
|
||||
Reverses an named enum to its value. Replace <code>Enum</code> with the actual num class.
|
||||
</Function>
|
||||
<Function name='FormatNumberAndSuffix' return='string' arguments='int num'>
|
||||
Returns the number passed to the function followed by its suffix ("th", "nd", and so on).
|
||||
</Function>
|
||||
@@ -78,28 +75,49 @@
|
||||
Converts <code>fSecs</code> to Minutes:Seconds.Milliseconds format.
|
||||
</Function>
|
||||
<Function name='Trace' return='void' arguments='string sString'>
|
||||
Alias for <Link function='lua.Trace' />.
|
||||
Alias for <Link class='lua' function='Trace' />.
|
||||
</Function>
|
||||
<Function name='Warn' return='void' arguments='string sString'>
|
||||
Alias for <Link function='lua.Warn' />.
|
||||
Alias for <Link class='lua' function='Warn' />.
|
||||
</Function>
|
||||
<Function name='Year' return='int' arguments=''>
|
||||
Returns the current year.
|
||||
</Function>
|
||||
<Function name='lua.Trace' return='void' arguments='string sString'>
|
||||
Writes <code>sString</code> to log.txt. Aliased by <Link function='Trace' />.
|
||||
</Function>
|
||||
<Function name='lua.Warn' return='void' arguments='string sString'>
|
||||
Writes <code>sString</code> to info.txt and log.txt as a warning. Aliased by <Link function='Warn' />.
|
||||
</Function>
|
||||
<Function name='lua.Flush' return='void' arguments='' >
|
||||
Flushes log files to disk.
|
||||
</Function>
|
||||
<Function name='mbstrlen' return='int' arguments='string sString'>
|
||||
Returns the length of the multi-byte character string <code>sString</code>.
|
||||
</Function>
|
||||
</GlobalFunctions>
|
||||
|
||||
<!-- Namespaces -->
|
||||
<Namespaces>
|
||||
<Namespace name='Enum'>
|
||||
<Function name='Reverse' return='int' arguments=''>
|
||||
Reverses an named enum to its value. Replace <code>Enum</code> with the actual num class.
|
||||
</Function>
|
||||
</Namespace>
|
||||
<Namespace name='GameManager'>
|
||||
<Function name='GetFirstStepsTypeForGame' return='StepsType' arguments='Game game'>
|
||||
Return the first of the <Link class='StepsType' /> corresponding to <code>game</code>.
|
||||
</Function>
|
||||
<Function name='StepsTypeToLocalizedString' return='string' arguments='StepsType st'>
|
||||
Return the localized string representation of <code>st</code>.
|
||||
</Function>
|
||||
</Namespace>
|
||||
<Namespace name='lua'>
|
||||
<Function name='Trace' return='void' arguments='string sString'>
|
||||
Writes <code>sString</code> to log.txt. Aliased by
|
||||
<Link class='GLOBAL' function='Trace' />.
|
||||
</Function>
|
||||
<Function name='Warn' return='void' arguments='string sString'>
|
||||
Writes <code>sString</code> to info.txt and log.txt as
|
||||
a warning. Aliased by <Link class='GLOBAL' function='Warn' />.
|
||||
</Function>
|
||||
<Function name='Flush' return='void' arguments='' >
|
||||
Flushes log files to disk.
|
||||
</Function>
|
||||
</Namespace>
|
||||
</Namespaces>
|
||||
|
||||
<!-- Classes -->
|
||||
<Classes>
|
||||
<Class name='Actor'>
|
||||
@@ -427,14 +445,6 @@
|
||||
Returns the name of the game such as "dance" or "pump".
|
||||
</Function>
|
||||
</Class>
|
||||
<Class name='GameManager'>
|
||||
<Function name='GetFirstStepsTypeForGame' return='StepsType' arguments='Game game'>
|
||||
Return the first of the <Link class='StepsType' /> corresponding to <code>game</code>.
|
||||
</Function>
|
||||
<Function name='StepsTypeToLocalizedString' return='string' arguments='StepsType st'>
|
||||
Return the localized string representation of <code>st</code>.
|
||||
</Function>
|
||||
</Class>
|
||||
<Class name='GameSoundManager'>
|
||||
<Function name='DimMusic' return='void' arguments='float fVolume, float fDuration'>
|
||||
Set the music volume to <code>fVolume</code> for <code>fDuration</code> seconds.
|
||||
|
||||
Reference in New Issue
Block a user