Fix for #1167
[jquery.git] / build / docs / style / docs.xsl
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
4 <xsl:template match="/*">
5 <html>
6 <head>
7         <title>jQuery Docs - <xsl:value-of select="/docs/@version"/> API</title>
8         <link rel="stylesheet" href="style/style.css"/>
9         <script src="../dist/jquery.js"></script>
10         <script src="js/tooltip.js"></script>
11         <script src="js/pager.js"></script>
12         <script src="js/doc.js"></script>
13 </head>
14 <body>
15         <h1>jQuery Docs - <xsl:value-of select="/docs/@version"/> API</h1>
16         <ul id="docs">
17                 <xsl:for-each select="method[not(@private)]">
18                         <xsl:sort select="translate(@name,'$.','')"/>
19                         <xsl:sort select="count(params)"/>
20                         <li>
21                                 <span class='type'><span class='tooltip'><xsl:value-of select="@type"/></span></span>
22                                 <span class='fn'>
23                                         <a href='#{@name}' class='name' title=''><xsl:value-of select="@name"/></a>
24                                                 <xsl:if test="not(@property)">(
25                                                         <xsl:for-each select="params">
26                                                                 <span class='arg-type tooltip'><xsl:value-of select="@type"/></span><xsl:text> </xsl:text>
27                                                                 <span class='arg-name tooltip' title='{desc}'><xsl:value-of select="@name"/></span>
28                                                                 <xsl:if test="position() != last()">
29                                                                         <xsl:if test="@any"> or </xsl:if>
30                                                                         <xsl:if test="not(@any)">, </xsl:if>
31                                                                 </xsl:if>
32                                                         </xsl:for-each>
33                                                  )</xsl:if>
34                                 </span> returns <span class='tooltip'><xsl:value-of select="@type"/></span>
35                                 <div class='short'>
36                                         <xsl:value-of select="@short"/>
37                                 </div>
38                                 <div class='more'>
39                                         <div class='desc'>
40                                                 <xsl:for-each select="desc">
41                                                         <xsl:call-template name="break" />
42                                                 </xsl:for-each>
43                                         </div>
44                                         <xsl:for-each select="examples">
45                                                 <div class='example'>
46                                                         <h5>Example:</h5>
47                                                         <xsl:if test="desc">
48                                                                 <p><xsl:value-of select="desc"/></p>
49                                                         </xsl:if>
50                                                         <pre><xsl:value-of select="code"/></pre>
51                                                         <xsl:if test="before">
52                                                                 <b>HTML:</b>
53                                                                 <pre><xsl:value-of select="before"/></pre>
54                                                         </xsl:if>
55                                                         <xsl:if test="result">
56                                                                 <b>Result:</b>
57                                                                 <pre><xsl:value-of select="result"/></pre>
58                                                         </xsl:if>
59                                                 </div>
60                                         </xsl:for-each>
61                                 </div>
62                         </li>
63                 </xsl:for-each>
64         </ul>
65
66         <p class="raw"><b>Raw Data:</b><xsl:text> </xsl:text><a href="data/jquery-docs-json.js">JSON</a>, <a href="data/jquery-docs-jsonp.js">JSONP</a>, <a href="data/jquery-docs-xml.xml">XML</a></p>
67 </body>
68 </html>
69 </xsl:template>
70
71 <xsl:template name="break">
72                 <xsl:param name="text" select="." />
73                 <xsl:choose>
74                         <xsl:when test="contains($text, '&#xa;&#xa;')">
75                                 <xsl:value-of select="substring-before($text, '&#xa;&#xa;')" />
76                                 <br /><br />
77                                 <xsl:call-template name="break">
78                                         <xsl:with-param name="text"     select="substring-after($text, '&#xa;&#xa;')" />
79                                 </xsl:call-template>
80                         </xsl:when>
81                         <xsl:otherwise>
82                                 <xsl:value-of select="$text" />
83                         </xsl:otherwise>
84                 </xsl:choose>
85         </xsl:template>
86
87 </xsl:stylesheet>