[Laszlo-checkins] r10244 - in openlaszlo/trunk/docs/src/xsl: . js2doc2dbk

dda@openlaszlo.org dda at openlaszlo.org
Mon Jul 7 19:21:51 PDT 2008


Author: dda
Date: 2008-07-07 19:21:18 -0700 (Mon, 07 Jul 2008)
New Revision: 10244

Modified:
   openlaszlo/trunk/docs/src/xsl/js2doc2dbk.xsl
   openlaszlo/trunk/docs/src/xsl/js2doc2dbk/synopsis.xsl
   openlaszlo/trunk/docs/src/xsl/js2doc2dbk/utilities.xsl
Log:
Change 20080707-dda-U by dda at lester.local on 2008-07-07 21:38:51 EDT
    in /Users/dda/laszlo/src/svn/openlaszlo/trunk-doc2
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Changed Lz* names in doc pages

New Features:

Bugs Fixed: LPP-6591 (Adjust doc tool to list Javascript name of <tag> as `lz.tag`),
    LPP-6593 (Adjust javascript type declarations to not use LzView)

Technical Reviewer: ptw (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
    Checking in per Amy's request, even though this is known to be incorrect,
    so there is something to look at, and adjust.

    Classes/Types of the form 'LzBlah' have been changed to 'lz.Blah' on the doc
    pages (these LPP-* only apply to the doc pages, not the navbar, although that
    is related with LPP-6600).  These changes occur in the synopsis,
    the Javascript type, the 'extends' and the 'inherited from' classnames.

     This is not right for several reasons:
      - Names like 'LzBlahBlah' should really be lz.blahblah when there is a tagname <blahblah>
      - When there is no tagname, it's not clear that there should be a lz.* name, and if so,
        what it should be called (lower case? camel case?)
      - Possibly some places that names are changed on the page they should not be.
      
    This changeset can be viewed as a starting point or proof of concept of how to accomplish
    these within the doc framework.  Some parts of it can be backed out, or adjusted as necessary.

Tests:
    Built doc pages and visually inspected.



Modified: openlaszlo/trunk/docs/src/xsl/js2doc2dbk/synopsis.xsl
===================================================================
--- openlaszlo/trunk/docs/src/xsl/js2doc2dbk/synopsis.xsl	2008-07-08 02:20:37 UTC (rev 10243)
+++ openlaszlo/trunk/docs/src/xsl/js2doc2dbk/synopsis.xsl	2008-07-08 02:21:18 UTC (rev 10244)
@@ -166,26 +166,30 @@
             <methodname><link linkend="{$id}"><xsl:value-of select="@name"/></link></methodname>
           </xsl:when>
           <xsl:otherwise>
-              <xsl:choose>
+            <xsl:choose>
               <xsl:when test="$static">
                 <!-- For static methods, show the class name --> 
-                <methodstaticclass><xsl:value-of select="../../@name"/>.</methodstaticclass><methodname><xsl:value-of select="@name"/></methodname>
+                <methodstaticclass><xsl:call-template name="lztype-rename">
+                    <xsl:with-param name="type" select="../../@name"/>
+                  </xsl:call-template>.</methodstaticclass>
               </xsl:when>
               <xsl:when test="ancestor::property/doc/tag[@name='lzxname']/text">
                 <!-- For instance methods, show name of tag if there is one --> 
-                <methodclass><xsl:value-of select="ancestor::property/doc/tag[@name='lzxname']/text"/>.</methodclass><methodname><xsl:value-of select="@name"/></methodname>
+                <methodclass><xsl:value-of select="ancestor::property/doc/tag[@name='lzxname']/text"/>.</methodclass>
               </xsl:when>
               <xsl:when test="ancestor::property/@name">
                 <!-- Or for instance methods, show the name of the class --> 
-                <methodclass><xsl:value-of select="ancestor::property/@name"/>.</methodclass><methodname><xsl:value-of select="@name"/></methodname>
+                <methodclass><xsl:call-template name="lztype-rename">
+                    <xsl:with-param name="type" select="ancestor::property/@name"/>
+                  </xsl:call-template>.</methodclass>
               </xsl:when>
                <xsl:otherwise>        
                  <xsl:if test="$warn.classname.not.found">
                    <xsl:message>No class name found for function synopsis: <xsl:value-of select="@id"/></xsl:message>
                  </xsl:if>                   
-                 <methodname><xsl:value-of select="@name"/></methodname>
                </xsl:otherwise>
-              </xsl:choose>                
+            </xsl:choose>                
+            <methodname><xsl:value-of select="@name"/></methodname>
           </xsl:otherwise>
         </xsl:choose>
         <xsl:for-each select="function/parameter">
@@ -196,11 +200,23 @@
               <xsl:when test="contains(@type, '...')">
                 <parameter><xsl:value-of select="concat('...', @name)"/></parameter>
                 <xsl:variable name="printable-type" select="substring-before(@type, '...')"/>
-                <xsl:if test="$printable-type"><type role="javascript"><xsl:value-of select="$printable-type"/></type></xsl:if>
+                <xsl:if test="$printable-type">
+                  <type role="javascript">
+                    <xsl:call-template name="lztype-rename">
+                      <xsl:with-param name="type" select="$printable-type"/>
+                    </xsl:call-template>
+                  </type>
+                </xsl:if>
               </xsl:when>
               <xsl:otherwise>
                 <parameter><xsl:value-of select="@name"/></parameter>
-                <xsl:if test="@type"><type role="javascript"><xsl:value-of select="@type"/></type></xsl:if>
+                <xsl:if test="@type">
+                  <type role="javascript">
+                    <xsl:call-template name="lztype-rename">
+                      <xsl:with-param name="type" select="@type"/>
+                    </xsl:call-template>
+                  </type>
+                </xsl:if>
               </xsl:otherwise>
             </xsl:choose>
           </methodparam>

Modified: openlaszlo/trunk/docs/src/xsl/js2doc2dbk/utilities.xsl
===================================================================
--- openlaszlo/trunk/docs/src/xsl/js2doc2dbk/utilities.xsl	2008-07-08 02:20:37 UTC (rev 10243)
+++ openlaszlo/trunk/docs/src/xsl/js2doc2dbk/utilities.xsl	2008-07-08 02:21:18 UTC (rev 10244)
@@ -90,6 +90,18 @@
       </xsl:choose>
     </xsl:template>
     
+    <xsl:template name="lztype-rename">
+      <xsl:param name="type"/>
+      <xsl:choose>
+        <xsl:when test="substring($type,1,2)='Lz'">
+          <xsl:value-of select="concat('lz.', substring-after($type, 'Lz'))"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$type"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:template>
+
     <xsl:template name="lzxtype2jstype">
       <xsl:param name="lzxtype"/>
       <xsl:choose>

Modified: openlaszlo/trunk/docs/src/xsl/js2doc2dbk.xsl
===================================================================
--- openlaszlo/trunk/docs/src/xsl/js2doc2dbk.xsl	2008-07-08 02:20:37 UTC (rev 10243)
+++ openlaszlo/trunk/docs/src/xsl/js2doc2dbk.xsl	2008-07-08 02:21:18 UTC (rev 10244)
@@ -691,7 +691,7 @@
                             <xsl:value-of select="@name"/>
                           </emphasis>
                         </entry>
-                        <entry><xsl:value-of select="@type"/></entry>
+                        <entry><xsl:call-template name="lztype-rename"><xsl:with-param name="type" select="@type"/></xsl:call-template></entry>
                         <!-- Important this appears on one line see: http://www.docbook.org/tdg/en/html/entry.html -->
                         <entry><xsl:apply-templates select="doc/text" mode="doc2dbk"/></entry>
                       </row>
@@ -719,7 +719,7 @@
                     <row>
                       <!-- There is no 'name' for a return type -->
                       <entry>&nbsp;</entry>
-                      <entry><xsl:value-of select="function/returns/@type"/></entry>
+                        <entry><xsl:call-template name="lztype-rename"><xsl:with-param name="type" select="function/returns/@type"/></xsl:call-template></entry>
                       <!-- Important this appears on one line see: http://www.docbook.org/tdg/en/html/entry.html -->
                       <entry><xsl:apply-templates select="function/returns/doc/text" mode="doc2dbk"/></entry>
                     </row>
@@ -1025,7 +1025,9 @@
 
       <xsl:if test="@name">
         <refsect1>
-          <xsl:text>JavaScript: </xsl:text><xsl:value-of select="@name"/>
+          <xsl:text>JavaScript: </xsl:text><xsl:call-template name="lztype-rename">
+            <xsl:with-param name="type" select="@name"/>
+          </xsl:call-template>
         </refsect1>
       </xsl:if>
 
@@ -1072,7 +1074,9 @@
           <xsl:text>&gt;</xsl:text>
         </xsl:when>
         <xsl:when test="@name">
-          <xsl:value-of select="@name"/>
+          <xsl:call-template name="lztype-rename">
+            <xsl:with-param name="type" select="@name"/>
+          </xsl:call-template>
         </xsl:when>
         <xsl:otherwise>
           <xsl:message><xsl:text>class without name or id: </xsl:text><xsl:value-of select="@id"/></xsl:message>
@@ -1094,7 +1098,9 @@
               <xsl:text>&gt;</xsl:text>
             </xsl:when>
             <xsl:otherwise>
-              <xsl:value-of select="$superclass/@name"/>
+              <xsl:call-template name="lztype-rename">
+                <xsl:with-param name="type" select="$superclass/@name"/>
+              </xsl:call-template>
             </xsl:otherwise>
           </xsl:choose>
         </link>
@@ -1481,8 +1487,12 @@
         <xsl:value-of select="&lzxtype;" />
       </entry>
       <entry role="attrjstype">
-        <xsl:call-template name="jstype">
-          <xsl:with-param name="tag" select="'type'"/>
+        <xsl:call-template name="lztype-rename">
+          <xsl:with-param name="type">
+            <xsl:call-template name="jstype">
+              <xsl:with-param name="tag" select="'type'"/>
+            </xsl:call-template>
+          </xsl:with-param>
         </xsl:call-template>
       </entry>
       <entry role="attrdefault">



More information about the Laszlo-checkins mailing list