Messed around with API document: Improved layout, removed animation, added <Content...
[jquery.git] / build / docs / style / docs.xsl
index 86c9a76..9c0735a 100644 (file)
@@ -4,7 +4,7 @@
 <xsl:template match="/*">
 <html>
 <head>
-       <title>jQuery Docs - API</title>
+       <title>jQuery Docs - <xsl:value-of select="/docs/@version"/> API</title>
        <link rel="stylesheet" href="style/style.css"/>
        <script src="../dist/jquery.js"></script>
        <script src="js/tooltip.js"></script>
@@ -12,7 +12,7 @@
        <script src="js/doc.js"></script>
 </head>
 <body>
-       <h1>jQuery Docs - API</h1>
+       <h1>jQuery Docs - <xsl:value-of select="/docs/@version"/> API</h1>
        <ul id="docs">
                <xsl:for-each select="method[not(@private)]">
                        <xsl:sort select="translate(@name,'$.','')"/>
                                                                </xsl:if>
                                                        </xsl:for-each>
                                                 )</xsl:if>
-                               </span>
+                               </span> returns <span class='tooltip'><xsl:value-of select="@type"/></span>
                                <div class='short'>
                                        <xsl:value-of select="@short"/>
                                </div>
                                <div class='more'>
                                        <div class='desc'>
-                                               <xsl:value-of select="desc"/>
+                                               <xsl:for-each select="desc">
+                                                       <xsl:call-template name="break" />
+                                               </xsl:for-each>
                                        </div>
                                        <xsl:for-each select="examples">
                                                <div class='example'>
 </html>
 </xsl:template>
 
+<xsl:template name="break">
+               <xsl:param name="text" select="." />
+               <xsl:choose>
+                       <xsl:when test="contains($text, '&#xa;&#xa;')">
+                               <xsl:value-of select="substring-before($text, '&#xa;&#xa;')" />
+                               <br /><br />
+                               <xsl:call-template name="break">
+                                       <xsl:with-param name="text"     select="substring-after($text, '&#xa;&#xa;')" />
+                               </xsl:call-template>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:value-of select="$text" />
+                       </xsl:otherwise>
+               </xsl:choose>
+       </xsl:template>
+
 </xsl:stylesheet>