grim/purple-objects-docbook

added support for signals

2013-06-01, Gary Kramlich
c1dc7c6285c8
Parents 945a40c74bef
Children 7b7ee86533d0
added support for signals
--- a/sheets/class.xsl Tue May 07 00:15:35 2013 -0500
+++ b/sheets/class.xsl Sat Jun 01 03:21:43 2013 -0500
@@ -5,6 +5,52 @@
<!-- variables -->
<xsl:variable name="wrap-args-at" select="2"/>
+ <!-- method/signal output -->
+ <xsl:template name="method">
+ <xsl:call-template name="scope"/>
+
+ <!-- start the method -->
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@name"/>
+
+ <!-- start the arguments -->
+ <xsl:text>(</xsl:text>
+
+ <!-- run through the arguments -->
+ <xsl:for-each select="argument">
+ <xsl:value-of select="@name"/>
+
+ <xsl:if test="@type">
+ <xsl:text> : </xsl:text>
+ <xsl:value-of select="@type"/>
+ </xsl:if>
+
+ <xsl:if test="position() != last()">
+ <xsl:text>,</xsl:text>
+ <xsl:choose>
+ <xsl:when test="position() mod $wrap-args-at = 0">
+ <xsl:text>\l </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text> </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:for-each>
+
+ <!-- finish the arguments -->
+ <xsl:text>)</xsl:text>
+
+ <!-- if we have a type output it -->
+ <xsl:if test="@type">
+ <xsl:text> : </xsl:text>
+ <xsl:value-of select="@type"/>
+ </xsl:if>
+
+ <!-- left justify the line -->
+ <xsl:text>\l</xsl:text>
+ </xsl:template>
+
<!-- the actual matching -->
<xsl:template match="class">
<!-- start the diagram -->
@@ -48,49 +94,15 @@
<!-- run through the methods -->
<xsl:for-each select="methods/method">
- <xsl:call-template name="scope"/>
-
- <!-- start the method -->
- <xsl:text> </xsl:text>
- <xsl:value-of select="@name"/>
-
- <!-- start the arguments -->
- <xsl:text>(</xsl:text>
-
- <!-- run through the arguments -->
- <xsl:for-each select="argument">
- <xsl:value-of select="@name"/>
-
- <xsl:if test="@type">
- <xsl:text> : </xsl:text>
- <xsl:value-of select="@type"/>
- </xsl:if>
+ <xsl:call-template name="method"/>
+ </xsl:for-each>
- <xsl:if test="position() != last()">
- <xsl:text>,</xsl:text>
- <xsl:choose>
- <xsl:when test="position() mod $wrap-args-at = 0">
- <xsl:text>\l </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text> </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
+ <!-- run through the signals -->
+ <xsl:text>|</xsl:text>
+ <xsl:for-each select="signals/signal">
+ <xsl:call-template name="method"/>
+ </xsl:for-each>
- <!-- finish the arguments -->
- <xsl:text>)</xsl:text>
-
- <!-- if we have a type output it -->
- <xsl:if test="@type">
- <xsl:text> : </xsl:text>
- <xsl:value-of select="@type"/>
- </xsl:if>
-
- <!-- left justify the line -->
- <xsl:text>\l</xsl:text>
- </xsl:for-each>
<!-- finish off the class node -->
<xsl:text>}"];</xsl:text>