[Laszlo-checkins] r8918 - openlaszlo/trunk/docs/src/xsl

dda@openlaszlo.org dda at openlaszlo.org
Tue Apr 29 19:59:53 PDT 2008


Author: dda
Date: 2008-04-29 19:59:47 -0700 (Tue, 29 Apr 2008)
New Revision: 8918

Modified:
   openlaszlo/trunk/docs/src/xsl/js2doc2dbk.xsl
Log:
Change 20080429-dda-A by dda at lester.local on 2008-04-29 22:21:02 EDT
    in /Users/dda/laszlo/src/svn/openlaszlo/trunk-doc
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: doc: Fixed broken 'inherited from <>' links

New Features:

Bugs Fixed: LPP-5892

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

Documentation:

Release Notes:

Details:
    Seems that whenever a class inherited from a class that
    is not a tagname, there was a problem with showing the classname.
    So now if there is a tagname superclass, we say 'inherited from <tagname>',
    and if there is no tagname, the name of the super class is shown:
    'inherited from SuperClassName'.

    Also, when a class or tag inherits from a class/tag that is marked
    private in documentation, then the superclass (or supertag) does not
    have a page to link to.  But there may be public methods/events/attributes that
    would otherwise be shown - these now appear without a link, since any link would
    have nothing to point to.

    Hopefully this will clean up a lot of odd looking pages.

Tests:
    built docs and inspected several pages, like LzContextMenuItem (inherits
    from LzMiniNode), and LzEvent, which inherits from a private base class.



Modified: openlaszlo/trunk/docs/src/xsl/js2doc2dbk.xsl
===================================================================
--- openlaszlo/trunk/docs/src/xsl/js2doc2dbk.xsl	2008-04-30 02:59:28 UTC (rev 8917)
+++ openlaszlo/trunk/docs/src/xsl/js2doc2dbk.xsl	2008-04-30 02:59:47 UTC (rev 8918)
@@ -1014,7 +1014,42 @@
         </xsl:otherwise>
       </xsl:choose>
     </xsl:template>
-  
+
+  <xsl:template name="show-super-link">
+    <xsl:param name="superclass"/>
+    <xsl:choose>
+      <xsl:when test="contains($visibility.filter, $superclass/@access)">
+        <!-- if visible, show it with a link -->
+        <link linkend="{$superclass/@id}">
+          <xsl:choose>
+            <xsl:when test="$superclass/doc/tag[@name='lzxname']/text">
+              <xsl:text>&lt;</xsl:text>
+              <xsl:value-of select="$superclass/doc/tag[@name='lzxname']/text"/>
+              <xsl:text>&gt;</xsl:text>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="$superclass/@name"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </link>
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- not visible, show the name but without a link -->
+        <xsl:choose>
+          <xsl:when test="$superclass/doc/tag[@name='lzxname']/text">
+            <xsl:text>&lt;</xsl:text>
+            <xsl:value-of select="$superclass/doc/tag[@name='lzxname']/text"/>
+            <xsl:text>&gt;</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$superclass/@name"/>
+          </xsl:otherwise>
+        </xsl:choose>
+        <xsl:text>&nbsp;(private)&nbsp;</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
   <xsl:template name="describe-inherited-attributes">
     <xsl:param name="class"/>        
     
@@ -1028,18 +1063,25 @@
       <refsect2>
         <title>
           <xsl:text>Attributes inherited from&nbsp;</xsl:text>
-          <link linkend="{$superclass/@id}">
-            <xsl:text>&lt;</xsl:text>
-            <xsl:value-of select="$superclass/doc/tag[@name='lzxname']/text"/>
-            <xsl:text>&gt;</xsl:text>
-          </link>
+          <xsl:call-template name="show-super-link">
+            <xsl:with-param name="superclass" select="$superclass"/>
+          </xsl:call-template>
         </title>
         <para>
           <xsl:variable name="inheritedattrs" select="$superclass/class/property[@name='__ivars__']/object/property[@access='public']"></xsl:variable>
           <xsl:variable name="allinheritedattrs" select="$inheritedattrs[not &isevent;]" />
           <xsl:for-each select="$allinheritedattrs">
             <xsl:sort select="@name"/>            
-            <link linkend="{@id}"><xsl:value-of select="@name"/></link>
+            <!-- even if attributes are public, if the class is not, there will
+                 be no class page to link to, so link must not appear -->
+            <xsl:choose>
+              <xsl:when test="contains($visibility.filter, $superclass/@access)">
+                <link linkend="{@id}"><xsl:value-of select="@name"/></link>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="@name"/>
+              </xsl:otherwise>
+            </xsl:choose>
             <xsl:text>, </xsl:text>
           </xsl:for-each>
         </para>
@@ -1073,16 +1115,23 @@
       <xsl:variable name="inheritedmethods" select="$superclass/class/property/object/property[@access='public']/function"></xsl:variable>      
         <title>
           <xsl:text>Methods inherited from&nbsp;</xsl:text>          
-          <link linkend="{$superclass/@id}">
-            <xsl:text>&lt;</xsl:text>            
-            <xsl:value-of select="$superclass/doc/tag[@name='lzxname']/text"/>
-            <xsl:text>&gt;</xsl:text>            
-          </link>
+          <xsl:call-template name="show-super-link">
+            <xsl:with-param name="superclass" select="$superclass"/>
+          </xsl:call-template>
         </title>
         <para>
           <xsl:for-each select="$inheritedmethods">
             <xsl:sort select="../@name"/>            
-            <link linkend="{../@id}"><xsl:value-of select="../@name"/></link>
+            <!-- even if methods are public, if the class is not, there will
+                 be no class page to link to, so link must not appear -->
+            <xsl:choose>
+              <xsl:when test="contains($visibility.filter, $superclass/@access)">
+                <link linkend="{../@id}"><xsl:value-of select="../@name"/></link>
+              </xsl:when>
+              <xsl:otherwise>
+               <xsl:value-of select="../@name"/>
+              </xsl:otherwise>
+            </xsl:choose>
             <xsl:text>, </xsl:text>
           </xsl:for-each>
         </para>
@@ -1117,16 +1166,23 @@
       <refsect2>
         <title>
           <xsl:text>Events inherited from&nbsp;</xsl:text>
-          <link linkend="{$superclass/@id}">
-            <xsl:text>&lt;</xsl:text>            
-            <xsl:value-of select="$superclass/doc/tag[@name='lzxname']/text"/>
-            <xsl:text>&gt;</xsl:text>            
-          </link>
+          <xsl:call-template name="show-super-link">
+            <xsl:with-param name="superclass" select="$superclass"/>
+          </xsl:call-template>
         </title>
         <para>
           <xsl:for-each select="$inheritedevents">
             <xsl:sort select="@name" />
-            <link linkend="{@id}"><xsl:value-of select="@name"/></link>
+            <!-- even if eventss are public, if the class is not, there will
+                 be no class page to link to, so link must not appear -->
+            <xsl:choose>
+              <xsl:when test="contains($visibility.filter, $superclass/@access)">
+                <link linkend="{@id}"><xsl:value-of select="@name"/></link>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="@name"/>
+              </xsl:otherwise>
+            </xsl:choose>
             <xsl:text>, </xsl:text>
           </xsl:for-each>
         </para>



More information about the Laszlo-checkins mailing list