Author: jgrandy
Date: 2007-06-28 08:43:09 -0700 (Thu, 28 Jun 2007)
New Revision: 5541

Modified:
   openlaszlo/branches/doctools/docs/src/xsl/js2doc2dbk.xsl
Log:
better index generation

Modified: openlaszlo/branches/doctools/docs/src/xsl/js2doc2dbk.xsl
===================================================================
--- openlaszlo/branches/doctools/docs/src/xsl/js2doc2dbk.xsl    2007-06-28 
06:44:48 UTC (rev 5540)
+++ openlaszlo/branches/doctools/docs/src/xsl/js2doc2dbk.xsl    2007-06-28 
15:43:09 UTC (rev 5541)
@@ -354,20 +354,20 @@
         <xsl:apply-templates select="." mode="desc"/>
       </xsl:variable>
       <xsl:variable name="xref">
-        <xsl:call-template name="itemdesc">
-          <xsl:with-param name="desc" select="$desc"/>
-        </xsl:call-template>
+        <xsl:apply-templates select="." mode="xref"/>
       </xsl:variable>
       
       <varlistentry>
         <term id="[EMAIL PROTECTED]" xreflabel="{$xref}">
+          <!-- how to get the indexterm to use a different name than 
xreflabel? -->
           <indexterm zone="[EMAIL PROTECTED]">
             <primary>
               <xsl:if test="$name != $sortasname">
                 <xsl:attribute name="sortas"><xsl:value-of 
select="$sortasname"/></xsl:attribute>
               </xsl:if>
-              <xsl:value-of select="$xref"/>
+              <xsl:value-of select="$name"/>
             </primary>
+            <secondary>Described</secondary>
           </indexterm>
           <xsl:value-of select="$desc"/>
         </term>
@@ -462,6 +462,42 @@
       </xsl:choose>
     </xsl:template>
     
+    <!-- CROSS REFERENCE DESCRIPTION -->
+    
+    <xsl:template match="property|initarg" mode="commonname">
+      <xsl:variable name="jsname" select="@name"/>
+      <xsl:variable name="lzxname" select="&tagname;"/>
+      <xsl:choose>
+        <xsl:when test="$jsname and not(starts-with($jsname,'lz.'))">
+          <xsl:value-of select="$jsname"/>
+        </xsl:when>
+        <xsl:when test="$lzxname and $lzxname != ''">
+          <xsl:value-of select="$lzxname"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message><xsl:text>property has no name</xsl:text></xsl:message>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:template>
+    
+    <xsl:template match="[EMAIL PROTECTED]'prototype' or @name='__ivars__' or 
@name='setters']" mode="parentpath">
+        <xsl:apply-templates select="(ancestor::property)[1]" 
mode="parentpath"/>
+    </xsl:template>
+    
+    <xsl:template match="property" mode="parentpath">
+      <xsl:variable name="parent" select="(ancestor::property)[1]"/>
+      <xsl:if test="$parent">
+        <xsl:apply-templates select="$parent" mode="parentpath"/>
+        <xsl:apply-templates select="$parent" mode="commonname"/>
+        <xsl:text>.</xsl:text>
+      </xsl:if>
+    </xsl:template>
+    
+    <xsl:template match="property|initarg" mode="xref">
+      <xsl:apply-templates select="." mode="parentpath"/>
+      <xsl:apply-templates select="." mode="desc"/>
+    </xsl:template>
+    
     <!-- REFENTRY HELPERS -->
     
     <xsl:template name="describe-parameters">
@@ -580,7 +616,7 @@
               </xsl:if>
               <xsl:value-of select="$jsname"/>
             </primary>
-            <secondary>Defined</secondary>
+            <secondary>Described</secondary>
             <xsl:if test="$lzxname">
               <seealso><xsl:value-of select="$lzxname"/></seealso>
             </xsl:if>
@@ -621,7 +657,7 @@
               <xsl:attribute name="sortas"><xsl:value-of 
select="$sortaslzx"/></xsl:attribute>
             </xsl:if>
             <primary><xsl:value-of select="$lzxname"/></primary>
-            <secondary>Defined</secondary>
+            <secondary>Described</secondary>
           </indexterm>
 <?ignore
           <xsl:if test="contains(@keywords, 'deprecated')">


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to