Author: ben
Date: 2007-11-04 16:59:08 -0800 (Sun, 04 Nov 2007)
New Revision: 7122
Modified:
openlaszlo/branches/paperpie/docs/includes/styles.css
openlaszlo/branches/paperpie/docs/src/xsl/js2doc2dbk.xsl
openlaszlo/branches/paperpie/docs/src/xsl/js2doc2dbk/utilities.xsl
openlaszlo/branches/paperpie/docs/src/xsl/refguide-html.xsl
Log:
Change 20071104-ben-p by [EMAIL PROTECTED] on 2007-11-04 15:45:04 PST
in /Users/ben/src/svn/openlaszlo/branches/paperpie
for http://svn.openlaszlo.org/openlaszlo/branches/paperpie
Summary: Progress towards attributes list improvements in reference.
Modified: openlaszlo/branches/paperpie/docs/includes/styles.css
===================================================================
--- openlaszlo/branches/paperpie/docs/includes/styles.css 2007-11-05
00:58:53 UTC (rev 7121)
+++ openlaszlo/branches/paperpie/docs/includes/styles.css 2007-11-05
00:59:08 UTC (rev 7122)
@@ -366,3 +366,12 @@
padding-top: 2pt;
padding-bottom: 2pt;
}
+
+/* Attributes List ****************** */
+td .literal {
+ font-size: 12px;
+ background-color: #FFFFFF;
+ font-weight: bold;
+ line-height: 18px;
+ color: #333333;
+}
\ No newline at end of file
Modified: openlaszlo/branches/paperpie/docs/src/xsl/js2doc2dbk/utilities.xsl
===================================================================
--- openlaszlo/branches/paperpie/docs/src/xsl/js2doc2dbk/utilities.xsl
2007-11-05 00:58:53 UTC (rev 7121)
+++ openlaszlo/branches/paperpie/docs/src/xsl/js2doc2dbk/utilities.xsl
2007-11-05 00:59:08 UTC (rev 7122)
@@ -76,7 +76,7 @@
</xsl:element>
</xsl:when>
<xsl:otherwise>
- <xsl:text>???</xsl:text>
+ <xsl:text>?jstype?</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Modified: openlaszlo/branches/paperpie/docs/src/xsl/js2doc2dbk.xsl
===================================================================
--- openlaszlo/branches/paperpie/docs/src/xsl/js2doc2dbk.xsl 2007-11-05
00:58:53 UTC (rev 7121)
+++ openlaszlo/branches/paperpie/docs/src/xsl/js2doc2dbk.xsl 2007-11-05
00:59:08 UTC (rev 7122)
@@ -203,34 +203,7 @@
</xsl:template>
- <xsl:template match="refnamediv">
- <div class="{name(.)}">
- <xsl:call-template name="dir">
- <xsl:with-param name="inherit" select="1"/>
- </xsl:call-template>
- <xsl:call-template name="anchor"/>
- <!-- Just show the name of the tag, not "Name: " -->
- <h2><xsl:apply-templates/></h2>
- </div>
- </xsl:template>
-
- <xsl:template match="refpurpose">
- <xsl:if test="node()">
- <div class="refpurpose">
- <xsl:apply-templates/>
- </div>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="refsynopsisdiv">
- <div class="{name(.)}">
- <xsl:call-template name="dir">
- <xsl:with-param name="inherit" select="1"/>
- </xsl:call-template>
- <xsl:call-template name="anchor"/>
- <xsl:apply-templates/>
- </div>
- </xsl:template>
+
<!-- DESCRIPTION -->
@@ -264,6 +237,7 @@
<xsl:variable name="svars" select="&objectvalue;/[EMAIL
PROTECTED]'setters']/object/property[&isvisible;]"/>
<xsl:variable name="pvars" select="&objectvalue;/[EMAIL
PROTECTED]'prototype']/object/property[&isvisible;]"/>
<xsl:variable name="ovars"
select="&objectvalue;/property[not(&privateslot;) and &isvisible;]"/>
+ <xsl:variable name="initargs"
select="class/initarg[not(contains(@access, 'private'))]" />
<!-- Static Properties -->
<xsl:if test="$show.properties.static">
@@ -271,6 +245,9 @@
<xsl:with-param name="members" select="$ovars[not(child::function)
and not(@type='LzEvent')]"/>
<xsl:with-param name="static" select="true()"/>
<xsl:with-param name="title" select="'Static Properties'"/>
+ <xsl:with-param name="initargs" select="$initargs" />
+ <xsl:with-param name="ivars" select="$ivars" />
+ <xsl:with-param name="setters" select="$svars" />
</xsl:call-template>
</xsl:if>
@@ -313,11 +290,15 @@
<!-- Properties -->
<xsl:if test="$show.members.attributes">
<xsl:call-template name="describe-members">
- <xsl:with-param name="members" select="$ivars |
&classvalue;/initarg"/>
+ <xsl:with-param name="members" select="$ivars |
&classvalue;/initarg | $svars"/>
<xsl:with-param name="title" select="'Attributes'"/>
+ <xsl:with-param name="initargs" select="$initargs" />
+ <xsl:with-param name="ivars" select="$ivars" />
+ <xsl:with-param name="setters" select="$svars" />
</xsl:call-template>
</xsl:if>
-
+
+
<!-- Inherited Attributes -->
<xsl:if test="$show.inherited.attributes">
<xsl:call-template name="describe-inherited-attributes">
@@ -410,15 +391,21 @@
<xsl:param name="subtitle"/>
<xsl:param name="describe-js" select="boolean(@name)"/>
<xsl:param name="describe-lzx" select="boolean(&tagname;)"/>
+ <xsl:param name="setters" />
+ <xsl:param name="ivars" />
+ <xsl:param name="initargs"/>
<xsl:choose>
- <xsl:when test="$title = 'Attributes'">
+ <xsl:when test="contains($title, 'Attributes')">
<xsl:call-template name="describe-members-grid">
<xsl:with-param name="members" select="$members"/>
<xsl:with-param name="static" select="$static"/>
<xsl:with-param name="title" select="$title"/>
<xsl:with-param name="subtitle" select="$subtitle"/>
<xsl:with-param name="describe-js" select="$describe-js" />
- <xsl:with-param name="describe-lzx" select="$describe-lzx" />
+ <xsl:with-param name="describe-lzx" select="$describe-lzx" />
+ <xsl:with-param name="setters" select="$setters"/>
+ <xsl:with-param name="ivars" select="$ivars"/>
+ <xsl:with-param name="initargs" select="$initargs"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
@@ -465,35 +452,43 @@
<xsl:param name="subtitle"/>
<xsl:param name="describe-js" select="boolean(@name)"/>
<xsl:param name="describe-lzx" select="boolean(&tagname;)"/>
+ <xsl:param name="setters" />
+ <xsl:param name="ivars" />
+ <xsl:param name="initargs" />
+
<xsl:variable name="visible-members"
select="$members[contains($visibility.filter,@access)]"/>
<xsl:if test="count($visible-members) > 0">
- <table frame="none" colsep="0" rowsep="0">
- <title><xsl:value-of select="$title"/></title>
+ <refsect2><title><xsl:value-of select="$title"/></title>
+ <informaltable frame="none" colsep="0">
<tgroup cols="4">
<colspec colname="Name" />
- <!-- <colspec colname="Usage" /> -->
<colspec colname="TypeTag" />
<colspec colname="TypeJS" />
<colspec colname="Default" />
- <!-- <colspec colname="Category" /> -->
+ <colspec colname="Category" />
<thead>
<row>
<entry align="left">Name</entry>
- <!-- <entry align="left">Usage</entry> -->
<entry align="left">Type (tag)</entry>
<entry align="left">Type (js)</entry>
<entry align="left">Default</entry>
- <!-- <entry align="left">Category</entry> -->
+ <entry align="left">Category</entry>
</row>
</thead>
<tbody>
<xsl:for-each select="$visible-members">
<xsl:sort select="translate(@name,'_$',' ')"/>
- <xsl:call-template name="member-data-row"></xsl:call-template>
+ <xsl:call-template name="member-data-row">
+ <xsl:with-param name="setters"
select="$setters"></xsl:with-param>
+ <xsl:with-param name="ivars"
select="$ivars"></xsl:with-param>
+ <xsl:with-param name="initargs"
select="$initargs"></xsl:with-param>
+ </xsl:call-template>
+ <row rowsep="1"><entry></entry></row>
</xsl:for-each>
</tbody>
</tgroup>
- </table>
+ </informaltable>
+ </refsect2>
</xsl:if>
</xsl:template>
@@ -512,8 +507,8 @@
</xsl:variable>
<xsl:if test="count($visible-members) > 0">
- <table frame="none" colsep="0" rowsep="0">
- <title>Events</title>
+ <refsect2><title>Events</title>
+ <informaltable frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colname="Name" />
<colspec colname="Description" />
@@ -533,15 +528,17 @@
<xsl:value-of select="@name"/>
</primary>
</indexterm>
- <xsl:value-of select="@name"/>
+ <literal>
+ <xsl:value-of select="@name"/>
+ </literal>
</entry>
<entry><xsl:value-of select="doc/text" /></entry>
</row>
</xsl:for-each>
</tbody>
</tgroup>
- </table>
-
+ </informaltable>
+ </refsect2>
</xsl:if>
@@ -549,6 +546,9 @@
<xsl:template match="initarg|property" mode="describe-member">
<!-- TO DO: special format for setters (properties with
../object/../[EMAIL PROTECTED]'setters'] structure) -->
+ <!-- [bshine 11.2.2007] Now I understand what Jim meant with this
comment! We need to describe
+ attributes specially (in some way) if they are listed as "setters" in
the js2doc output.
+ I do not yet understand exactly what to do here. -->
<xsl:param name="static"/>
<xsl:param name="describe-js" select="true()"/>
<xsl:param name="describe-lzx" select="true()"/>
@@ -621,7 +621,6 @@
</xsl:if>
<xsl:if test="function/returns">
<refsect3>
- <para>function/returns exists benyeah</para>
<informaltable frame="none" colsep="0" rowsep="0" pgwide="1">
<tgroup cols="2">
<colspec colname="Type" />
@@ -1120,10 +1119,74 @@
<xsl:template name="member-data-row">
<xsl:param name="describe-js" select="true()"/>
<xsl:param name="describe-lzx" select="true()"/>
+ <xsl:param name="setters"/>
+ <xsl:param name="ivars" />
+ <xsl:param name="initargs" />
<xsl:variable name="jsname" select="@name"/>
<xsl:variable name="lzxname" select="&tagname;"/>
<xsl:variable name="name" select="&commonname;"/>
+
+ <!-- checks for membership in the set of instance variables -->
+ <xsl:variable name="isinstancevar" select="count ([EMAIL PROTECTED] ) >
0"/>
+
+ <!-- checks for memebership in the set of initargs -->
+ <xsl:variable name="isinitarg" select="count( [EMAIL PROTECTED] ) > 0" />
+
+ <!-- checks whether a setter exists that sets this attribute. -->
+ <xsl:variable name="hassetter" select="count( [EMAIL PROTECTED] ) > 0" />
+
+ <!-- Check whether the current node is a setter. This is different from
+ asking whether it *has* a setter; this refers to its place in the DOM,
+ not just whether it's a member of a set. -->
+ <xsl:variable name="issetter" select="count( ancestor::[EMAIL
PROTECTED]'setters'] ) > 0" />
+
+ <xsl:choose>
+ <xsl:when test="$hassetter and not($issetter) and $isinstancevar">
+ <!-- If there is a setter, but this isn't it, then show this one's
doc.
+ This makes use show the instance variable, not the setter, because
+ the instance variable usually has better doc. -->
+ <xsl:call-template name="unique-attribute">
+ <xsl:with-param name="issetter" select="false()"></xsl:with-param>
+ <xsl:with-param name="isinstancevar"
select="$isinstancevar"></xsl:with-param>
+ <xsl:with-param name="isinitarg"
select="$isinitarg"></xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$hassetter and $issetter and $isinstancevar">
+ <!-- This is the setter that goes with an instance variable.
+ Don't output it, because we just want to show the instance variable,
+ not the setter. -->
+ </xsl:when>
+ <xsl:when test="$hassetter and not($issetter) and not($isinstancevar)">
+ <!-- TROUBLE. If we've got a setter, but this isn't it, then this
should
+ be an instance variable. Otherwise it's weird. We'll output it
+ as a non-setter attribute, and see what happens. -->
+ <xsl:message>Warning on attribute list in member-data-row:
+ <xsl:value-of select="$jsname"/> has a setter, but is neither a
setter nor an instance variable.</xsl:message>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- This handles all the cases where there is no setter. It's easy,
we just
+ pass it through to the unique-attribute template. (If an attribute
does
+ turn up more than once, then it's an error of a kind we haven't
thought of yet.
+ Maybe initarg.
+ -->
+ <xsl:call-template name="unique-attribute">
+ <xsl:with-param name="issetter" select="$issetter"></xsl:with-param>
+ <xsl:with-param name="isinstancevar"
select="$isinstancevar"></xsl:with-param>
+ <xsl:with-param name="isinitarg"
select="$isinitarg"></xsl:with-param>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="unique-attribute">
+ <xsl:param name="issetter" select="false()"></xsl:param>
+ <xsl:param name="isinstancevar" select="true()"></xsl:param>
+ <xsl:param name="isinitarg" select="false()"></xsl:param>
+
+ <xsl:variable name="jsname" select="@name"/>
+ <xsl:variable name="lzxname" select="&tagname;"/>
+ <xsl:variable name="name" select="&commonname;"/>
<xsl:variable name="sortasname" select="translate($name,'_$',' ')"/>
<xsl:variable name="id" select="@id"/>
<xsl:variable name="desc">
@@ -1133,7 +1196,7 @@
<xsl:variable name="xref">
<xsl:apply-templates select="." mode="xref"/>
</xsl:variable>
-
+
<term id="[EMAIL PROTECTED]" xreflabel="{$xref}">
<!-- how to get the indexterm to use a different name than xreflabel? -->
<indexterm zone="[EMAIL PROTECTED]">
@@ -1153,7 +1216,6 @@
<entry><literal>
<xsl:value-of select="@name"/>
</literal></entry>
- <!-- "Usage" will go here <entry>(unknown)</entry> -->
<entry><xsl:value-of select="&lzxtype;" /> </entry>
<entry>
<xsl:call-template name="jstype">
@@ -1161,26 +1223,36 @@
</xsl:call-template>
</entry>
<entry><xsl:value-of select="&lzxdefault;" /></entry>
- <!-- Category will go here
- <entry>
+ <!-- The code here begins to implement the "new" specification for
+ describing attribute categories: read-only, read/write,
initialize-only,
+ and special.
+ The breakdown implemented below does not print those keywords,
+ because (now that I'm writing the code) those keywords don't seem
+ to entirely fit. Or maybe they fit but I can't figure out how to
+ map what I know about the attributes to those keywords. I am
+ here printing out what I think is useful information from the
+ metadata about these attributes that I do have.
+ [bshine 2007.11.04]
+ -->
+ <entry>
<xsl:choose>
- <xsl:when test="initarg">
- <xsl:text>initarg</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:when test="@modifiers = 'final'">final</xsl:when>
+ <xsl:when test="$isinstancevar and not(@modifiers =
'final')">read/write</xsl:when>
+ <xsl:otherwise>special/strange (TODO: ben)</xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:if test="not($isinstancevar) and $issetter">virtual </xsl:if>
+ <xsl:if test="$isinitarg">initarg </xsl:if>
</entry>
- -->
</row>
<xsl:if test="doc/text">
<row rowsep="1">
- <entry namest="TagType" nameend="Category">
+ <entry namest="TypeTag" nameend="Category">
<xsl:value-of select="doc/text" />
</entry>
</row>
</xsl:if>
</xsl:template>
-
+
</xsl:stylesheet>
\ No newline at end of file
Modified: openlaszlo/branches/paperpie/docs/src/xsl/refguide-html.xsl
===================================================================
--- openlaszlo/branches/paperpie/docs/src/xsl/refguide-html.xsl 2007-11-05
00:58:53 UTC (rev 7121)
+++ openlaszlo/branches/paperpie/docs/src/xsl/refguide-html.xsl 2007-11-05
00:59:08 UTC (rev 7122)
@@ -20,7 +20,34 @@
<xsl:param name="linenumbering.extension.frag" select="0"/>
-
+ <xsl:template match="refnamediv">
+ <div class="{name(.)}">
+ <xsl:call-template name="dir">
+ <xsl:with-param name="inherit" select="1"/>
+ </xsl:call-template>
+ <xsl:call-template name="anchor"/>
+ <!-- Just show the name of the tag, not "Name: " -->
+ <h2><xsl:apply-templates/></h2>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="refpurpose">
+ <xsl:if test="node()">
+ <div class="refpurpose">
+ <xsl:apply-templates/>
+ </div>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="refsynopsisdiv">
+ <div class="{name(.)}">
+ <xsl:call-template name="dir">
+ <xsl:with-param name="inherit" select="1"/>
+ </xsl:call-template>
+ <xsl:call-template name="anchor"/>
+ <xsl:apply-templates/>
+ </div>
+ </xsl:template>
</xsl:stylesheet>
\ No newline at end of file
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins