[Laszlo-checkins] r7221 - in openlaszlo/trunk/docs/src: developers developers/programs developers/tutorials developers/tutorials/programs xsl

ben@openlaszlo.org ben at openlaszlo.org
Mon Nov 12 15:23:30 PST 2007


Author: ben
Date: 2007-11-12 15:23:23 -0800 (Mon, 12 Nov 2007)
New Revision: 7221

Added:
   openlaszlo/trunk/docs/src/developers/tutorials/comp-intro.dbk
   openlaszlo/trunk/docs/src/developers/tutorials/programs/comp-intro-$1.lzx
   openlaszlo/trunk/docs/src/developers/tutorials/programs/comp-intro-$2.lzx
   openlaszlo/trunk/docs/src/developers/tutorials/programs/comp-intro-$3.lzx
   openlaszlo/trunk/docs/src/developers/tutorials/programs/comp-intro-$4.lzx
   openlaszlo/trunk/docs/src/developers/tutorials/programs/comp-intro-$5.lzx
Removed:
   openlaszlo/trunk/docs/src/developers/comp-intro.dbk
   openlaszlo/trunk/docs/src/developers/programs/comp-intro-$1.lzx
   openlaszlo/trunk/docs/src/developers/programs/comp-intro-$2.lzx
   openlaszlo/trunk/docs/src/developers/programs/comp-intro-$3.lzx
   openlaszlo/trunk/docs/src/developers/programs/comp-intro-$4.lzx
   openlaszlo/trunk/docs/src/developers/programs/comp-intro-$5.lzx
Modified:
   openlaszlo/trunk/docs/src/developers/index.dbk
   openlaszlo/trunk/docs/src/xsl/common-html.xsl
   openlaszlo/trunk/docs/src/xsl/js2doc2dbk.xsl
   openlaszlo/trunk/docs/src/xsl/simple-driver.xsl
Log:
Change 20071112-ben-6 by ben at slim.local on 2007-11-12 15:09:33 PST
    in /Users/ben/src/svn/openlaszlo/trunk/docs/src/developers
    for http://svn.openlaszlo.org/openlaszlo/trunk/docs/src/developers

Summary: Move components intro tutorial into tutorials directory

Bugs Fixed: LPP-5005 problem with the generated html for Chapter 6. Introduction to Components

Technical Reviewer: none
Doc Reviewer: sundman (pending)

Documentation:
The "introduction to components" chapter is presented as a "tutorial" in the developer's
guide, but it was stored on disk as a sibling with the non-tutorial chapters. The
XSLT for generating the html treated the chapter as a tutorial, and uses relative
paths to the includes for css and js. Those paths were wrong for this chapter, 
because the html comp-intro.html didn't live in the right place for a tutorial. 
This change moves the file into the correct place for this file, and makes
the devguide's index.dbk point to the moved chapter. 

Also moved all the associated examples into developers/tutorials/programs. 


Tests:
http://localhost:8080/trunk/docs/developers/tutorials/comp-intro.html
Notice that the fonts and colors are right (meaning that the css is in place)
and that the live examples are present and work. (The edit button does not
work; this is noted in many open bugs.) 



Deleted: openlaszlo/trunk/docs/src/developers/comp-intro.dbk

Modified: openlaszlo/trunk/docs/src/developers/index.dbk
===================================================================
--- openlaszlo/trunk/docs/src/developers/index.dbk	2007-11-12 23:23:04 UTC (rev 7220)
+++ openlaszlo/trunk/docs/src/developers/index.dbk	2007-11-12 23:23:23 UTC (rev 7221)
@@ -29,7 +29,7 @@
   <part id="developers.tutorials">
     <title>Tutorial Introduction</title>
     <xi:include href="tutorials/laszlo_basics.dbk"/>
-    <xi:include href="comp-intro.dbk"/>
+    <xi:include href="tutorials/comp-intro.dbk"/>
     <xi:include href="tutorials/views.dbk"/>
     <xi:include href="tutorials/art_assets.dbk"/>
     <xi:include href="tutorials/text.dbk"/>

Deleted: openlaszlo/trunk/docs/src/developers/programs/comp-intro-$1.lzx

Deleted: openlaszlo/trunk/docs/src/developers/programs/comp-intro-$2.lzx

Deleted: openlaszlo/trunk/docs/src/developers/programs/comp-intro-$3.lzx

Deleted: openlaszlo/trunk/docs/src/developers/programs/comp-intro-$4.lzx

Deleted: openlaszlo/trunk/docs/src/developers/programs/comp-intro-$5.lzx

Copied: openlaszlo/trunk/docs/src/developers/tutorials/comp-intro.dbk (from rev 7219, openlaszlo/trunk/docs/src/developers/comp-intro.dbk)

Copied: openlaszlo/trunk/docs/src/developers/tutorials/programs/comp-intro-$1.lzx (from rev 7219, openlaszlo/trunk/docs/src/developers/programs/comp-intro-$1.lzx)

Copied: openlaszlo/trunk/docs/src/developers/tutorials/programs/comp-intro-$2.lzx (from rev 7219, openlaszlo/trunk/docs/src/developers/programs/comp-intro-$2.lzx)

Copied: openlaszlo/trunk/docs/src/developers/tutorials/programs/comp-intro-$3.lzx (from rev 7219, openlaszlo/trunk/docs/src/developers/programs/comp-intro-$3.lzx)

Copied: openlaszlo/trunk/docs/src/developers/tutorials/programs/comp-intro-$4.lzx (from rev 7219, openlaszlo/trunk/docs/src/developers/programs/comp-intro-$4.lzx)

Copied: openlaszlo/trunk/docs/src/developers/tutorials/programs/comp-intro-$5.lzx (from rev 7219, openlaszlo/trunk/docs/src/developers/programs/comp-intro-$5.lzx)

Modified: openlaszlo/trunk/docs/src/xsl/common-html.xsl
===================================================================
--- openlaszlo/trunk/docs/src/xsl/common-html.xsl	2007-11-12 23:23:04 UTC (rev 7220)
+++ openlaszlo/trunk/docs/src/xsl/common-html.xsl	2007-11-12 23:23:23 UTC (rev 7221)
@@ -45,6 +45,8 @@
   
   <xsl:param name="warn.no.programlisting.canvas.width" select="false()"/>
   
+  <xsl:param name="show.examples.debuginfo" select="false()" />
+  
   <xsl:template name="base.book.name">
     <xsl:choose>
       <xsl:when test="contains(ancestor::part/@id, 'developers.tutorials')">developers/tutorials</xsl:when>
@@ -249,14 +251,16 @@
         </a>
       </div>
       <xsl:text>&#x0a;</xsl:text>
-      <pre>
-        localdir: <xsl:value-of select="$localdir"/>
-        basedir: <xsl:value-of select="$base.dir"/>
-        fname: <xsl:value-of select="$fname"/>
-        base.book.name: <xsl:call-template name="base.book.name"  />
-        root.relative: <xsl:value-of select="$root.relative"/>
-        relative.path.to.lpshome: <xsl:value-of select="$relative.path.to.lpshome"/>
-      </pre> 
+      <xsl:if test="$show.examples.debuginfo">
+        <pre>
+          localdir: <xsl:value-of select="$localdir"/>
+          basedir: <xsl:value-of select="$base.dir"/>
+          fname: <xsl:value-of select="$fname"/>
+          base.book.name: <xsl:call-template name="base.book.name"  />
+          root.relative: <xsl:value-of select="$root.relative"/>
+          relative.path.to.lpshome: <xsl:value-of select="$relative.path.to.lpshome"/>
+        </pre> 
+      </xsl:if>
     </xsl:if>
   </xsl:template>
 

Modified: openlaszlo/trunk/docs/src/xsl/js2doc2dbk.xsl
===================================================================
--- openlaszlo/trunk/docs/src/xsl/js2doc2dbk.xsl	2007-11-12 23:23:04 UTC (rev 7220)
+++ openlaszlo/trunk/docs/src/xsl/js2doc2dbk.xsl	2007-11-12 23:23:23 UTC (rev 7221)
@@ -22,6 +22,12 @@
 <!ENTITY classvalue     '(class|function)'>
 <!ENTITY privateslot    '(@name="prototype" or @name="__ivars__" or @name="dependencies" or @name="setters" or @name="tagname")'>
 
+<!ENTITY readonly       '(@modifiers="readonly" or @modifiers="read-only" or @keywords="read-only" or @keywords="readonly")'>
+<!ENTITY final          '(@modifiers="final" or @keywords="final")'>
+<!ENTITY unwritable     '(@modifiers="readonly" or @modifiers="read-only" or @keywords="read-only" or @keywords="readonly" or @modifiers="final" or @keywords="final")'>
+
+<!ENTITY isevent          '((doc/tag[@name="lzxtype"]/text) = "event" or @type="LzEvent")'>
+
 ]>
         
 <xsl:stylesheet version="1.0"
@@ -41,7 +47,7 @@
     <xsl:param name="show.members.attributes" select="true()" />
     <xsl:param name="show.properties.static" select="false()" />
     <xsl:param name="show.methods.static" select="false()" />  
-    <xsl:param name="show.events.static" select="false()" />
+    <xsl:param name="show.events.static" select="true()" />
     <xsl:param name="show.inherited.attributes" select="true()" />
     <xsl:param name="show.setters" select="false()" />    
     <xsl:param name="show.prototype.methods" select="true()" />
@@ -237,12 +243,13 @@
         <xsl:variable name="svars" select="&objectvalue;/property[@name='setters']/object/property[&isvisible;]"/>
         <xsl:variable name="pvars" select="&objectvalue;/property[@name='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'))]" />
+        <xsl:variable name="events" select="&objectvalue;/property[@name='__ivars__']/object/property[doc/tag[@name='lzxtype']/text = 'event' and &isvisible;]" />
+        <xsl:variable name="initargs" select="class/initarg[not(contains(@access, 'private'))]" />       
         
         <!-- Static Properties -->
         <xsl:if test="$show.properties.static">
           <xsl:call-template name="describe-members">
-            <xsl:with-param name="members" select="$ovars[not(child::function) and not(@type='LzEvent')]"/>
+            <xsl:with-param name="members" select="$ovars[not(child::function) and not(&isevent;)]"/>
             <xsl:with-param name="static" select="true()"/>
             <xsl:with-param name="title" select="'Static Properties'"/>
             <xsl:with-param name="initargs" select="$initargs" />
@@ -335,7 +342,7 @@
         <!-- (Prototype) Events -->
         <xsl:if test="$show.prototype.events">
           <xsl:call-template name="describe-events">
-            <xsl:with-param name="members" select="$pvars[@type='LzEvent']"/>
+            <xsl:with-param name="members" select="$events"/>
             <xsl:with-param name="title" select="'Events'"/>
           </xsl:call-template>
         </xsl:if>
@@ -540,6 +547,11 @@
       </refsect2>
     </xsl:if>
     
+    <xsl:if test="count($visible-members) = 0">
+      <refsect2><title>Events</title>
+        <para>(no events found)</para>
+      </refsect2>
+    </xsl:if>
     
   </xsl:template>
 
@@ -1083,7 +1095,7 @@
     <xsl:variable name="extends" select="$class/@extends"/>
     <xsl:variable name="superclass" select="(key('id',$extends) | key('name-lzx',$extends))[1]"/>
     <xsl:if test="$superclass">  
-      <xsl:variable name="inheritedevents" select="$superclass/class/property/object/property[@type='LzEvent' and &ispublic;]"></xsl:variable>
+      <xsl:variable name="inheritedevents" select="$superclass/class/property[@name='__ivars__']/object/property[doc/tag[@name='lzxtype']/text = 'event' and &ispublic;]"></xsl:variable>
       <refsect2>
         <title>
           <xsl:text>Events inherited from&nbsp;</xsl:text>
@@ -1206,6 +1218,8 @@
       <xsl:apply-templates select="." mode="xref"/>
     </xsl:variable>
         
+    <!-- don't generate a term if this is an event -->
+    <xsl:if test="not(&isevent;)">
     <term id="{@id}" xreflabel="{$xref}">
       <!-- how to get the indexterm to use a different name than xreflabel? -->
       <indexterm zone="{@id}">
@@ -1217,7 +1231,8 @@
         </primary>
       </indexterm>
       <xsl:value-of select="$desc"/>
-    </term>    
+    </term>  
+    </xsl:if>
     <row>
       <xsl:if test="not (doc/text)">
         <xsl:attribute name="rowsep">0</xsl:attribute>
@@ -1245,13 +1260,16 @@
         -->
       <entry>
         <xsl:choose>
-          <xsl:when test="@modifiers = 'final'">initialize-only</xsl:when>
-          <xsl:when test="$isinstancevar and not(@modifiers = 'final')">read/write</xsl:when>
-          <xsl:when test="not($isinstancevar) and $issetter">(TODO: declare attribute)</xsl:when>          
-          <xsl:otherwise>(FIXME: otherwise)</xsl:otherwise>
-        </xsl:choose>
-        
-        <xsl:if test="$isinitarg"> (initarg) </xsl:if>                                     
+          <xsl:when test="&final; and ($isinstancevar or $isinitarg)">initialize-only</xsl:when>
+          <xsl:when test="&readonly;">readonly</xsl:when>          
+          <xsl:when test="not(&unwritable;) and $isinstancevar">read/write</xsl:when>
+          <xsl:when test="not(&unwritable;) and not($isinstancevar) and not($issetter)">(FIXME: declare attribute (non-setter))</xsl:when>
+          <xsl:when test="not(&unwritable;) and not($isinstancevar) and $issetter">(FIXME: declare attribute (setter))</xsl:when>          
+          <xsl:otherwise>(FIXME: otherwise) <xsl:if test="&final;">final</xsl:if> <xsl:if test="&readonly;">readonly</xsl:if></xsl:otherwise>
+        </xsl:choose>        
+        <xsl:if test="&isevent;">
+          event
+        </xsl:if>
       </entry>
     </row>
     <xsl:if test="doc/text">  

Modified: openlaszlo/trunk/docs/src/xsl/simple-driver.xsl
===================================================================
--- openlaszlo/trunk/docs/src/xsl/simple-driver.xsl	2007-11-12 23:23:04 UTC (rev 7220)
+++ openlaszlo/trunk/docs/src/xsl/simple-driver.xsl	2007-11-12 23:23:23 UTC (rev 7221)
@@ -19,7 +19,7 @@
 <!ENTITY classvalue     '(class|function)'>
 <!ENTITY privateslot    '(@name="prototype" or @name="__ivars__" or @name="dependencies" or @name="setters" or @name="tagname")'>
 
-<!ENTITY isvisible      '(contains($visibility.filter, @access))'>
+<!ENTITY isvisible      '(contains("public", @access))'>
 
 <!ENTITY ispublic       '(@access="public")'>
 
@@ -42,10 +42,14 @@
         <xsl:variable name="setters" select="class/property[@name='setters']/object/property[not(contains(@access, 'private'))]" />
         <xsl:variable name="instancevariables" select="class/property[@name='__ivars__']/object/property[not(contains(@access, 'private'))]" />
         <xsl:variable name="initargs" select="class/initarg[not(contains(@access, 'private'))]" />
+        <xsl:variable name="events" select="class/property[@name='__ivars__']/object/property[doc/tag[@name='lzxtype']/text = 'event' and &isvisible;]" />        
         
         
         property with name <xsl:value-of select="$classname"/>
         
+        events: <xsl:for-each select="$events">
+            <xsl:value-of select="@name"/>,             
+        </xsl:for-each>        
             
         <!-- things that are both instancevariables and setters are read/write attributes -->
         <xsl:variable name="setters-names" select="$setters/@name" />



More information about the Laszlo-checkins mailing list