]> git.donarmstrong.com Git - dactyl.git/blobdiff - common/content/help.xsl
Import 1.0b7.1 supporting Firefox up to 8.*
[dactyl.git] / common / content / help.xsl
index e70875bcaa805c4d254078f38b23edcf3a56be5c..a93f9a7a8f6fe96c6a299e3466f3a56acc4e6799 100644 (file)
 
         <xsl:if test="//dactyl:toc[1 and self::*]">
             <div dactyl:highlight="HelpTOC">
-                <h2>Contents</h2>
+                <h2><!--L-->Contents</h2>
                 <xsl:if test="@start">
                     <xsl:call-template name="toc">
                         <xsl:with-param name="level" select="number(@start)"/>
                 </xsl:when>
                 <xsl:when test="contains($type, 'list') or contains($type, 'map')">
                     <span dactyl:highlight="HelpString" delim=""><xsl:apply-templates mode="help-1"/></span>
-                    <xsl:if test=". = ''">(empty)</xsl:if>
+                    <xsl:if test=". = ''"><!--L-->(empty)</xsl:if>
                 </xsl:when>
                 <xsl:otherwise>
                     <span>
         <a>
             <xsl:choose>
                 <xsl:when test="not(@topic)"/>
-                <xsl:when test="regexp:match(@topic, '^([a-zA-Z]*:|[^/]*#|/)', '')">
+                <xsl:when test="regexp:match(@topic, '^([a-zA-Z]+:|[^/]*#|/)', '')">
                     <xsl:attribute name="href"><xsl:value-of select="@topic"/></xsl:attribute>
                 </xsl:when>
                 <xsl:otherwise>
                     <xsl:attribute name="href"><xsl:value-of select="concat('dactyl://help-tag/', @topic)"/></xsl:attribute>
                 </xsl:otherwise>
             </xsl:choose>
-            <xsl:if test="regexp:match(@topic, '^[a-zA-Z]*:', '')
+            <xsl:if test="regexp:match(@topic, '^[a-zA-Z]+:', '')
                     and not(starts-with(@topic, 'mailto:') or
                             starts-with(@topic, 'chrome:') or
                             starts-with(@topic, 'resource:') or
     <xsl:template match="dactyl:deprecated" mode="help-2">
         <p style="clear: both;">
             <xsl:apply-templates select="@*" mode="help-1"/>
-            <span dactyl:highlight="HelpWarning">Deprecated:</span>
+            <span dactyl:highlight="HelpWarning"><!--L-->Deprecated:</span>
             <xsl:text> </xsl:text>
             <xsl:apply-templates select="node()" mode="help-1"/>
         </p>
         <p style="clear: both;">
             <xsl:apply-templates select="@*" mode="help-1"/>
             <div style="clear: both;"/>
-            <span dactyl:highlight="HelpNote">Note:</span>
+            <span dactyl:highlight="HelpNote"><!--L-->Note:</span>
             <xsl:text> </xsl:text>
             <xsl:apply-templates select="node()" mode="help-1"/>
         </p>
         <p style="clear: both;">
             <xsl:apply-templates select="@*" mode="help-1"/>
             <div style="clear: both;"/>
-            <span dactyl:highlight="HelpWarning">Warning:</span>
+            <span dactyl:highlight="HelpWarning"><!--L-->Warning:</span>
             <xsl:text> </xsl:text>
             <xsl:apply-templates select="node()" mode="help-1"/>
         </p>
             <xsl:apply-templates select="@*|node()" mode="help-1"/>
         </div>
     </xsl:template>
-    <xsl:template match="dactyl:str | dactyl:type" mode="help-2">
-        <span>
-            <xsl:if test="self::dactyl:str"><xsl:attribute name="dactyl:highlight">HelpString</xsl:attribute></xsl:if>
-            <xsl:if test="self::dactyl:type"><xsl:attribute name="dactyl:highlight">HelpType</xsl:attribute></xsl:if>
+    <xsl:template match="dactyl:type" mode="help-2">
+        <a dactyl:highlight="HelpType">
+            <xsl:choose>
+                <xsl:when test="contains(ancestor::*/@document-tags, concat(' ', ., ' '))">
+                    <xsl:attribute name="href">#<xsl:value-of select="."/></xsl:attribute>
+                </xsl:when>
+                <xsl:when test="not(. = 'boolean' or . = 'number' or . = 'string')">
+                    <xsl:attribute name="href">dactyl://help-tag/<xsl:value-of select="."/></xsl:attribute>
+                </xsl:when>
+            </xsl:choose>
+            <xsl:apply-templates select="@*|node()" mode="help-1"/>
+        </a>
+    </xsl:template>
+    <xsl:template match="dactyl:str" mode="help-2">
+        <span dactyl:highlight="HelpString">
             <xsl:apply-templates select="@*|node()" mode="help-1"/>
         </span>
     </xsl:template>