Skip to content
This repository
Browse code

Upgraded grunt-jquery-content to 0.5.x.

  • Loading branch information...
commit 0ccfc1904c408662eb4c6df403c6037f0e7c7450 1 parent c596377
Scott González authored September 13, 2012
25  cat2tax.xsl
... ...
@@ -1,25 +0,0 @@
1  
-<?xml version="1.0" encoding="UTF-8"?>
2  
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3  
-
4  
-	<xsl:template match="category">
5  
-		<item>
6  
-			<name><xsl:value-of select="@name"/></name>
7  
-			<slug><xsl:value-of select="@slug"/></slug>
8  
-			<xsl:if test="desc/child::node()">
9  
-				<description><xsl:copy-of select="desc/text()|desc/*"/></description>
10  
-			</xsl:if>
11  
-			<xsl:if test="category">
12  
-				<children>
13  
-					<xsl:apply-templates select="category"/>
14  
-				</children>
15  
-			</xsl:if>
16  
-		</item>
17  
-	</xsl:template>
18  
-
19  
-	<xsl:template match="categories">
20  
-		<category>
21  
-			<xsl:apply-templates select="node()"/>
22  
-		</category>
23  
-	</xsl:template>
24  
-
25  
-</xsl:stylesheet>
761  entries2html-base.xsl
... ...
@@ -1,761 +0,0 @@
1  
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
2  
-<xsl:output method="html" omit-xml-declaration="yes"/>
3  
-
4  
-<!-- Set this to true to display links to /category/version/{version} -->
5  
-<xsl:variable name="version-category-links" select="false()"/>
6  
-<!-- Set this to false to prevent prefixing method names with a dot -->
7  
-<xsl:variable name="method-prefix-dot" select="true()"/>
8  
-
9  
-<xsl:template match="/">
10  
-	<script>{
11  
-		"title":
12  
-			<xsl:call-template name="escape-string">
13  
-				<xsl:with-param name="s" select="//entry/title/text()"/>
14  
-			</xsl:call-template>,
15  
-		"excerpt":
16  
-			<xsl:call-template name="escape-string">
17  
-				<xsl:with-param name="s" select="//entry[1]/desc/text()|//entry[1]/desc/*"/>
18  
-			</xsl:call-template>,
19  
-		"termSlugs": {
20  
-			"category": [
21  
-				<xsl:for-each select="//entry/category">
22  
-					<xsl:if test="position() &gt; 1"><xsl:text>,</xsl:text></xsl:if>
23  
-					<xsl:text>"</xsl:text>
24  
-					<xsl:value-of select="@slug"/>
25  
-					<xsl:text>"</xsl:text>
26  
-				</xsl:for-each>
27  
-			]
28  
-		}
29  
-	}</script>
30  
-
31  
-	<xsl:if test="count(//entry) &gt; 1">
32  
-		<xsl:call-template name="toc"/>
33  
-	</xsl:if>
34  
-
35  
-	<xsl:for-each select="//entry">
36  
-		<xsl:variable name="entry-name" select="@name"/>
37  
-		<xsl:variable name="entry-name-trans" select="translate($entry-name,'$., ()/{}','s---')"/>
38  
-		<xsl:variable name="entry-type" select="@type"/>
39  
-		<xsl:variable name="entry-index" select="position()"/>
40  
-		<xsl:variable name="entry-pos" select="concat($entry-name-trans,$entry-index)"/>
41  
-		<xsl:variable name="number-examples" select="count(example)"/>
42  
-
43  
-		<xsl:if test="$entry-type='widget'">
44  
-			<xsl:call-template name="widget-quick-nav"/>
45  
-		</xsl:if>
46  
-
47  
-		<article>
48  
-			<xsl:attribute name="id">
49  
-				<xsl:value-of select="$entry-pos"/>
50  
-			</xsl:attribute>
51  
-			<xsl:attribute name="class">
52  
-				<xsl:value-of select="concat('entry ', $entry-type)"/>
53  
-			</xsl:attribute>
54  
-
55  
-			<xsl:call-template name="entry-title"/>
56  
-			<div class="entry-wrapper">
57  
-				<xsl:call-template name="entry-body"/>
58  
-
59  
-				<xsl:if test="normalize-space(longdesc/*)">
60  
-					<div class="longdesc">
61  
-						<xsl:apply-templates select="longdesc"/>
62  
-					</div>
63  
-				</xsl:if>
64  
-
65  
-				<xsl:if test="note">
66  
-					<h3>Additional Notes:</h3>
67  
-					<div class="longdesc">
68  
-						<ul>
69  
-							<xsl:for-each select="note">
70  
-								<li><xsl:call-template name="note"/></li>
71  
-							</xsl:for-each>
72  
-						</ul>
73  
-					</div>
74  
-				</xsl:if>
75  
-
76  
-				<xsl:if test="example">
77  
-					<section class="entry-examples">
78  
-						<xsl:attribute name="id">
79  
-							<xsl:text>entry-examples</xsl:text>
80  
-							<xsl:if test="$entry-index &gt; 1">
81  
-								<xsl:text>-</xsl:text><xsl:value-of select="$entry-index - 1"/>
82  
-							</xsl:if>
83  
-						</xsl:attribute>
84  
-
85  
-						<header>
86  
-							<h2 class="underline">Example<xsl:if test="$number-examples &gt; 1">s</xsl:if>:</h2>
87  
-						</header>
88  
-
89  
-						<xsl:apply-templates select="example">
90  
-							<xsl:with-param name="entry-index" select="$entry-index"/>
91  
-							<xsl:with-param name="number-examples" select="$number-examples"/>
92  
-						</xsl:apply-templates>
93  
-					</section>
94  
-				</xsl:if>
95  
-			</div>
96  
-		</article>
97  
-	</xsl:for-each>
98  
-</xsl:template>
99  
-
100  
-<xsl:template name="toc">
101  
-	<div class="toc">
102  
-		<h4><span>Contents:</span></h4>
103  
-		<ul class="toc-list">
104  
-			<xsl:for-each select="//entry">
105  
-				<xsl:variable name="entry-name-trans" select="translate(@name,'$., ()/{}','s---')" />
106  
-				<xsl:variable name="entry-url" select="concat('#',$entry-name-trans,position())"/>
107  
-				<xsl:choose>
108  
-					<xsl:when test="@type='method'">
109  
-						<xsl:call-template name="toc-method">
110  
-							<xsl:with-param name="entry-url" select="$entry-url"/>
111  
-						</xsl:call-template>
112  
-					</xsl:when>
113  
-					<xsl:otherwise>
114  
-						<xsl:call-template name="toc-basic">
115  
-							<xsl:with-param name="entry-url" select="$entry-url"/>
116  
-						</xsl:call-template>
117  
-					</xsl:otherwise>
118  
-				</xsl:choose>
119  
-			</xsl:for-each>
120  
-		</ul>
121  
-	</div>
122  
-</xsl:template>
123  
-
124  
-<xsl:template name="toc-basic">
125  
-	<xsl:param name="entry-url"/>
126  
-	<li><a href="{$entry-url}"><xsl:value-of select="@name"/></a></li>
127  
-</xsl:template>
128  
-
129  
-<xsl:template name="toc-method">
130  
-	<xsl:param name="entry-url"/>
131  
-	<xsl:variable name="entry-name" select="@name"/>
132  
-
133  
-	<li>
134  
-		<a href="{$entry-url}">
135  
-			<xsl:for-each select="signature[1]">
136  
-				<xsl:call-template name="method-signature">
137  
-					<xsl:with-param name="method-name" select="$entry-name"/>
138  
-					<xsl:with-param name="dot" select="$method-prefix-dot"/>
139  
-				</xsl:call-template>
140  
-			</xsl:for-each>
141  
-		</a>
142  
-
143  
-		<ul>
144  
-			<xsl:for-each select="signature">
145  
-				<li>
146  
-					<xsl:call-template name="method-signature">
147  
-						<xsl:with-param name="method-name" select="$entry-name"/>
148  
-						<xsl:with-param name="dot" select="$method-prefix-dot"/>
149  
-					</xsl:call-template>
150  
-				</li>
151  
-			</xsl:for-each>
152  
-		</ul>
153  
-	</li>
154  
-</xsl:template>
155  
-
156  
-<xsl:template name="entry-title">
157  
-	<xsl:param name="entry-type" select="@type"/>
158  
-	<xsl:param name="entry-name" select="@name"/>
159  
-
160  
-	<h2 class="section-title">
161  
-		<xsl:choose>
162  
-			<xsl:when test="$entry-type='method'">
163  
-				<span class="name">
164  
-					<xsl:for-each select="signature[1]">
165  
-						<xsl:call-template name="method-signature">
166  
-							<xsl:with-param name="method-name" select="$entry-name"/>
167  
-							<xsl:with-param name="dot" select="$method-prefix-dot"/>
168  
-						</xsl:call-template>
169  
-					</xsl:for-each>
170  
-				</span>
171  
-				<xsl:call-template name="return-value"/>
172  
-			</xsl:when>
173  
-			<xsl:when test="$entry-type='selector'">
174  
-				<span>
175  
-					<xsl:value-of select="@name"/>
176  
-					<xsl:text> selector</xsl:text>
177  
-				</span>
178  
-			</xsl:when>
179  
-			<xsl:when test="$entry-type='property'">
180  
-				<span>
181  
-					<xsl:value-of select="@name"/>
182  
-				</span>
183  
-				<xsl:call-template name="return-value"/>
184  
-			</xsl:when>
185  
-			<xsl:otherwise>
186  
-				<span><xsl:value-of select="title"/></span>
187  
-			</xsl:otherwise>
188  
-		</xsl:choose>
189  
-		<xsl:if test="./added">
190  
-			<span class="versionAdded">version added: <xsl:value-of select="added"/></span>
191  
-		</xsl:if>
192  
-	</h2>
193  
-</xsl:template>
194  
-
195  
-<xsl:template name="entry-body">
196  
-	<p class="desc"><strong>Description: </strong> <xsl:value-of select="desc"/></p>
197  
-	<xsl:choose>
198  
-		<xsl:when test="@type='selector'">
199  
-			<xsl:call-template name="entry-body-selector"/>
200  
-		</xsl:when>
201  
-		<xsl:when test="@type='property'">
202  
-			<xsl:call-template name="entry-body-property"/>
203  
-		</xsl:when>
204  
-		<xsl:when test="@type='method'">
205  
-			<xsl:call-template name="entry-body-method"/>
206  
-		</xsl:when>
207  
-		<xsl:when test="@type='widget'">
208  
-			<xsl:call-template name="entry-body-widget"/>
209  
-		</xsl:when>
210  
-		<xsl:when test="@type='effect'">
211  
-			<xsl:call-template name="entry-body-effect"/>
212  
-		</xsl:when>
213  
-	</xsl:choose>
214  
-</xsl:template>
215  
-
216  
-<xsl:template name="entry-body-selector">
217  
-	<ul class="signatures">
218  
-		<li class="signature">
219  
-			<h4 class="name">
220  
-				<xsl:if test="signature/added">
221  
-					<span class="versionAdded">
222  
-						version added:
223  
-						<a href="/category/version/{signature/added}/">
224  
-							<xsl:value-of select="signature/added"/>
225  
-						</a>
226  
-					</span>
227  
-				</xsl:if>
228  
-				<xsl:text>jQuery( "</xsl:text><xsl:value-of select="sample"/><xsl:text>" )</xsl:text>
229  
-			</h4>
230  
-
231  
-			<xsl:for-each select="signature/argument">
232  
-				<p class="argument">
233  
-					<strong><xsl:value-of select="@name"/>: </strong>
234  
-					<xsl:copy-of select="desc/text()|desc/*"/>
235  
-				</p>
236  
-			</xsl:for-each>
237  
-		</li>
238  
-	</ul>
239  
-</xsl:template>
240  
-
241  
-<xsl:template name="entry-body-property">
242  
-	<ul class="signatures">
243  
-		<li class="signature">
244  
-			<h4 class="name">
245  
-				<xsl:if test="signature/added">
246  
-					<span class="versionAdded">
247  
-						version added:
248  
-						<a href="/category/version/{signature/added}/">
249  
-							<xsl:value-of select="added"/>
250  
-						</a>
251  
-					</span>
252  
-				</xsl:if>
253  
-				<xsl:value-of select="@name"/>
254  
-			</h4>
255  
-
256  
-			<xsl:if test="properties">
257  
-				<ul><xsl:for-each select="properties/property">
258  
-					<xsl:apply-templates select="."/>
259  
-				</xsl:for-each></ul>
260  
-			</xsl:if>
261  
-		</li>
262  
-	</ul>
263  
-</xsl:template>
264  
-
265  
-<xsl:template name="entry-body-method">
266  
-	<xsl:variable name="entry-name" select="@name"/>
267  
-	<xsl:variable name="entry-name-trans" select="translate($entry-name,'$., ()/{}','s---')"/>
268  
-
269  
-	<ul class="signatures">
270  
-		<xsl:for-each select="signature">
271  
-			<li class="signature">
272  
-				<xsl:attribute name="id">
273  
-					<xsl:value-of select="$entry-name-trans"/>
274  
-					<xsl:for-each select="argument">
275  
-						<xsl:variable name="arg-name" select="translate(@name, ' ,.)(', '--')"/>
276  
-						<xsl:text>-</xsl:text><xsl:value-of select="$arg-name"/>
277  
-					</xsl:for-each>
278  
-				</xsl:attribute>
279  
-
280  
-				<h4 class="name">
281  
-					<xsl:if test="./added">
282  
-						<span class="versionAdded">
283  
-							version added:
284  
-							<a href="/category/version/{added}/">
285  
-								<xsl:value-of select="added"/>
286  
-							</a>
287  
-						</span>
288  
-					</xsl:if>
289  
-					<xsl:call-template name="method-signature">
290  
-						<xsl:with-param name="method-name" select="$entry-name"/>
291  
-						<xsl:with-param name="dot" select="$method-prefix-dot"/>
292  
-					</xsl:call-template>
293  
-				</h4>
294  
-
295  
-				<xsl:call-template name="arguments"/>
296  
-			</li>
297  
-		</xsl:for-each>
298  
-	</ul>
299  
-</xsl:template>
300  
-
301  
-<xsl:template name="entry-body-widget">
302  
-	<xsl:variable name="entry-name" select="@name"/>
303  
-
304  
-	<xsl:if test="options">
305  
-		<section id="options">
306  
-			<header>
307  
-				<h2 class="underline">Options</h2>
308  
-			</header>
309  
-			<xsl:for-each select="options/option">
310  
-				<xsl:sort select="@name"/>
311  
-				<div id="option-{@name}">
312  
-					<xsl:attribute name="class">
313  
-						<xsl:text>api-item</xsl:text>
314  
-						<xsl:if test="position() = 1">
315  
-							<xsl:text> first-item</xsl:text>
316  
-						</xsl:if>
317  
-					</xsl:attribute>
318  
-
319  
-					<h3>
320  
-						<xsl:value-of select="@name"/>
321  
-						<span class="option-type">
322  
-							<strong>Type: </strong>
323  
-							<xsl:call-template name="render-types"/>
324  
-						</span>
325  
-					</h3>
326  
-					<div class="default">
327  
-						<strong>Default: </strong>
328  
-						<code><xsl:value-of select="@default"/></code>
329  
-					</div>
330  
-					<div>
331  
-						<xsl:apply-templates select="desc">
332  
-							<xsl:with-param name="entry-name" select="$entry-name"/>
333  
-						</xsl:apply-templates>
334  
-						<xsl:call-template name="version-details"/>
335  
-					</div>
336  
-					<xsl:if test="type/desc">
337  
-						<strong>Multiple types supported:</strong>
338  
-						<ul>
339  
-							<xsl:for-each select="type/desc">
340  
-								<li>
341  
-									<strong><xsl:value-of select="../@name"/></strong>
342  
-									<xsl:text>: </xsl:text>
343  
-									<xsl:apply-templates select="."/>
344  
-								</li>
345  
-							</xsl:for-each>
346  
-						</ul>
347  
-					</xsl:if>
348  
-					<xsl:apply-templates select="example">
349  
-						<xsl:with-param name="number-examples" select="count(example)"/>
350  
-					</xsl:apply-templates>
351  
-				</div>
352  
-			</xsl:for-each>
353  
-		</section>
354  
-	</xsl:if>
355  
-	<xsl:if test="methods">
356  
-		<section id="methods">
357  
-			<header>
358  
-				<h2 class="underline">Methods</h2>
359  
-			</header>
360  
-			<xsl:for-each select="methods/method">
361  
-				<xsl:sort select="@name"/>
362  
-				<xsl:variable name="method-name" select="@name"/>
363  
-				<xsl:variable name="method-position" select="position()"/>
364  
-				<div id="method-{$method-name}">
365  
-
366  
-					<xsl:for-each select="signature | self::node()[count(signature) = 0]">
367  
-						<div>
368  
-							<xsl:attribute name="class">
369  
-								<xsl:text>api-item</xsl:text>
370  
-								<xsl:if test="$method-position = 1 and position() = 1">
371  
-									<xsl:text> first-item</xsl:text>
372  
-								</xsl:if>
373  
-							</xsl:attribute>
374  
-
375  
-							<xsl:call-template name="widget-method-event">
376  
-								<xsl:with-param name="entry-name" select="$entry-name"/>
377  
-								<xsl:with-param name="method-name" select="$method-name"/>
378  
-							</xsl:call-template>
379  
-						</div>
380  
-					</xsl:for-each>
381  
-				</div>
382  
-			</xsl:for-each>
383  
-		</section>
384  
-	</xsl:if>
385  
-	<xsl:if test="events">
386  
-		<section id="events">
387  
-			<header>
388  
-				<h2 class="underline">Events</h2>
389  
-			</header>
390  
-			<xsl:for-each select="events/event">
391  
-				<xsl:sort select="@name"/>
392  
-				<div id="event-{@name}">
393  
-					<xsl:attribute name="class">
394  
-						<xsl:text>api-item</xsl:text>
395  
-						<xsl:if test="position() = 1">
396  
-							<xsl:text> first-item</xsl:text>
397  
-						</xsl:if>
398  
-					</xsl:attribute>
399  
-
400  
-					<xsl:call-template name="widget-method-event">
401  
-						<xsl:with-param name="entry-name" select="$entry-name"/>
402  
-						<xsl:with-param name="method-name" select="@name"/>
403  
-					</xsl:call-template>
404  
-				</div>
405  
-			</xsl:for-each>
406  
-		</section>
407  
-	</xsl:if>
408  
-</xsl:template>
409  
-
410  
-<xsl:template name="entry-body-effect">
411  
-	<ul class="signatures">
412  
-		<li class="signature">
413  
-			<h4 class="name">
414  
-				<xsl:if test="signature/added">
415  
-					<span class="versionAdded">
416  
-						version added:
417  
-						<a href="/category/version/{signature/added}/">
418  
-							<xsl:value-of select="added"/>
419  
-						</a>
420  
-					</span>
421  
-				</xsl:if>
422  
-				<xsl:value-of select="@name"/>
423  
-			</h4>
424  
-
425  
-			<xsl:if test="arguments">
426  
-				<ul><xsl:for-each select="arguments/argument">
427  
-					<xsl:apply-templates select="."/>
428  
-				</xsl:for-each></ul>
429  
-			</xsl:if>
430  
-		</li>
431  
-	</ul>
432  
-</xsl:template>
433  
-
434  
-<xsl:template name="widget-quick-nav">
435  
-	<section class="quick-nav">
436  
-		<header>
437  
-			<h2>QuickNav</h2>
438  
-		</header>
439  
-
440  
-		<div class="quick-nav-section">
441  
-			<h3>Options</h3>
442  
-			<xsl:for-each select="options/option">
443  
-				<xsl:variable name="name" select="@name"/>
444  
-				<div><a href="#option-{$name}"><xsl:value-of select="$name"/></a></div>
445  
-			</xsl:for-each>
446  
-		</div>
447  
-
448  
-		<div class="quick-nav-section">
449  
-			<h3>Methods</h3>
450  
-			<xsl:for-each select="methods/method">
451  
-				<xsl:variable name="name" select="@name"/>
452  
-				<div><a href="#method-{$name}"><xsl:value-of select="$name"/></a></div>
453  
-			</xsl:for-each>
454  
-		</div>
455  
-
456  
-		<div class="quick-nav-section">
457  
-			<h3>Events</h3>
458  
-			<xsl:for-each select="events/event">
459  
-				<xsl:variable name="name" select="@name"/>
460  
-				<div><a href="#event-{$name}"><xsl:value-of select="$name"/></a></div>
461  
-			</xsl:for-each>
462  
-		</div>
463  
-	</section>
464  
-</xsl:template>
465  
-
466  
-<!-- examples -->
467  
-<xsl:template match="example">
468  
-	<xsl:param name="entry-index"/>
469  
-	<xsl:param name="number-examples"/>
470  
-
471  
-	<div class="entry-example">
472  
-		<xsl:attribute name="id">
473  
-			<xsl:text>example-</xsl:text>
474  
-			<xsl:if test="$entry-index &gt; 1">
475  
-				<xsl:value-of select="$entry-index - 1"/>
476  
-				<xsl:text>-</xsl:text>
477  
-			</xsl:if>
478  
-			<xsl:value-of select="position() - 1"/>
479  
-		</xsl:attribute>
480  
-
481  
-		<h4>
482  
-			<xsl:if test="$number-examples &gt; 1">Example: </xsl:if>
483  
-			<span class="desc"><xsl:apply-templates select="desc"/></span>
484  
-		</h4>
485  
-		<pre><code data-linenum="true">
486  
-			<xsl:choose>
487  
-				<xsl:when test="html">
488  
-					<xsl:call-template name="example-code"/>
489  
-				</xsl:when>
490  
-				<xsl:otherwise>
491  
-					<xsl:copy-of select="code/text()"/>
492  
-				</xsl:otherwise>
493  
-			</xsl:choose>
494  
-		</code></pre>
495  
-
496  
-		<xsl:if test="html">
497  
-			<h4>Demo:</h4>
498  
-			<div class="demo code-demo">
499  
-				<xsl:if test="height">
500  
-					<xsl:attribute name="data-height">
501  
-						<xsl:value-of select="height"/>
502  
-					</xsl:attribute>
503  
-				</xsl:if>
504  
-			</div>
505  
-		</xsl:if>
506  
-
507  
-		<xsl:if test="results">
508  
-			<h4>Result:</h4>
509  
-			<pre><code class="results">
510  
-				<xsl:value-of select="results"/>
511  
-			</code></pre>
512  
-		</xsl:if>
513  
-	</div>
514  
-</xsl:template>
515  
-<xsl:template name="example-code"/>
516  
-
517  
-<!--
518  
-	Render type(s) for an argument element.
519  
-	Type can either be a @type attribute or one or more <type> child elements.
520  
--->
521  
-<xsl:template name="render-types">
522  
-	<xsl:if test="@type and type">
523  
-		<strong>ERROR: Use <i>either</i> @type or type elements</strong>
524  
-	</xsl:if>
525  
-
526  
-	<!-- a single type -->
527  
-	<xsl:if test="@type">
528  
-		<xsl:call-template name="render-type">
529  
-			<xsl:with-param name="typename" select="@type" />
530  
-		</xsl:call-template>
531  
-	</xsl:if>
532  
-
533  
-	<!-- elements. Render each type, comma seperated -->
534  
-	<xsl:if test="type">
535  
-		<xsl:for-each select="type">
536  
-			<xsl:if test="position() &gt; 1">
537  
-				<xsl:text> or </xsl:text>
538  
-			</xsl:if>
539  
-			<xsl:call-template name="render-type">
540  
-				<xsl:with-param name="typename" select="@name" />
541  
-			</xsl:call-template>
542  
-		</xsl:for-each>
543  
-	</xsl:if>
544  
-</xsl:template>
545  
-
546  
-<!-- Render a single type -->
547  
-<xsl:template name="render-type">
548  
-	<xsl:param name="typename"/>
549  
-	<xsl:choose>
550  
-	<!--
551  
-		If the type is "Function" we special case and write the function signature,
552  
-		e.g. function(String)=>String
553  
-		- formal arguments are child elements to the current element
554  
-		- the return element is optional
555  
-	-->
556  
-	<xsl:when test="$typename = 'Function'">
557  
-		<a href="http://api.jquery.com/Types/#Function">Function</a>
558  
-		<xsl:call-template name="render-type-function"/>
559  
-
560  
-		<!-- display return type if present -->
561  
-		<xsl:if test="return or @return">
562  
-			=>
563  
-			<xsl:call-template name="render-return-types" />
564  
-		</xsl:if>
565  
-	</xsl:when>
566  
-	<xsl:otherwise>
567  
-		<!-- not function - just display typename -->
568  
-		<a href="http://api.jquery.com/Types#{$typename}"><xsl:value-of select="$typename" /></a>
569  
-	</xsl:otherwise>
570  
-	</xsl:choose>
571  
-</xsl:template>
572  
-
573  
-<xsl:template name="render-type-function">
574  
-	<xsl:text>(</xsl:text>
575  
-	<xsl:if test="argument">
576  
-		<xsl:text> </xsl:text>
577  
-		<xsl:for-each select="argument">
578  
-			<xsl:if test="position() &gt; 1">, </xsl:if>
579  
-			<a href="http://api.jquery.com/Types#{@type}">
580  
-				<xsl:value-of select="@type"/>
581  
-			</a>
582  
-			<xsl:text> </xsl:text>
583  
-			<xsl:value-of select="@name"/>
584  
-			<xsl:if test="@type = 'Function'">
585  
-				<xsl:call-template name="render-type-function"/>
586  
-			</xsl:if>
587  
-		</xsl:for-each>
588  
-		<xsl:text> </xsl:text>
589  
-	</xsl:if>
590  
-	<xsl:text>)</xsl:text>
591  
-</xsl:template>
592  
-
593  
-<xsl:template name="render-return-types">
594  
-	<xsl:if test="@return and return">
595  
-		<strong>ERROR: Use <i>either</i> @return or return element</strong>
596  
-	</xsl:if>
597  
-
598  
-	<!-- return attribute -->
599  
-	<xsl:if test="@return">
600  
-		<xsl:call-template name="render-type">
601  
-			<xsl:with-param name="typename" select="@return"/>
602  
-		</xsl:call-template>
603  
-	</xsl:if>
604  
-
605  
-	<!-- a return element -->
606  
-	<xsl:if test="return">
607  
-		<xsl:for-each select="return">
608  
-			<xsl:if test="position() &gt; 1">
609  
-				<strong>ERROR: A single return element is expected</strong>
610  
-			</xsl:if>
611  
-			<xsl:call-template name="render-types"/>
612  
-		</xsl:for-each>
613  
-	</xsl:if>
614  
-</xsl:template>
615  
-
616  
-<xsl:template name="return-value">
617  
-	<xsl:if test="@return != ''">
618  
-		<xsl:text> </xsl:text>
619  
-		<span class="returns">
620  
-			<xsl:text>Returns: </xsl:text>
621  
-			<a class="return" href="http://api.jquery.com/Types/#{@return}">
622  
-				<xsl:value-of select="@return"/>
623  
-			</a>
624  
-		</span>
625  
-	</xsl:if>
626  
-</xsl:template>
627  
-
628  
-<xsl:template name="method-signature">
629  
-	<xsl:param name="method-name"/>
630  
-	<xsl:param name="dot" select="false()"/>
631  
-
632  
-	<xsl:if test="$dot and not(contains($method-name, '.')) and $method-name != 'jQuery'">.</xsl:if>
633  
-	<xsl:value-of select="$method-name"/>
634  
-	<xsl:text>(</xsl:text>
635  
-	<xsl:if test="argument">
636  
-		<xsl:text> </xsl:text>
637  
-		<xsl:for-each select="argument">
638  
-			<xsl:if test="@optional"> [</xsl:if>
639  
-			<xsl:if test="position() &gt; 1"><xsl:text>, </xsl:text></xsl:if>
640  
-			<xsl:value-of select="@name"/>
641  
-			<xsl:if test="@optional"><xsl:text> ]</xsl:text></xsl:if>
642  
-		</xsl:for-each>
643  
-		<xsl:text> </xsl:text>
644  
-	</xsl:if>
645  
-	<xsl:text>)</xsl:text>
646  
-</xsl:template>
647  
-
648  
-<xsl:template name="arguments">
649  
-	<xsl:if test="argument">
650  
-		<ul>
651  
-			<xsl:apply-templates select="argument"/>
652  
-		</ul>
653  
-	</xsl:if>
654  
-</xsl:template>
655  
-<!-- arguments and properties are rendered the same way and nest -->
656  
-<xsl:template match="argument|property">
657  
-	<li>
658  
-		<div>
659  
-			<strong><xsl:value-of select="@name"/></strong>
660  
-			<xsl:if test="@default"> (default: <xsl:value-of select="@default"/>)</xsl:if>
661  
-		</div>
662  
-		<div>Type: <xsl:call-template name="render-types"/></div>
663  
-		<div>
664  
-			<xsl:apply-templates select="desc"/>
665  
-			<xsl:call-template name="version-details"/>
666  
-		</div>
667  
-		<xsl:if test="property">
668  
-			<ul>
669  
-				<xsl:apply-templates select="property"/>
670  
-			</ul>
671  
-		</xsl:if>
672  
-	</li>
673  
-</xsl:template>
674  
-
675  
-<xsl:template name="version-details">
676  
-	<xsl:if test="@added">
677  
-		<xsl:text> </xsl:text>
678  
-		<xsl:choose>
679  
-			<xsl:when test="$version-category-links">
680  
-				<strong>(added <a href="/category/version/{@added}/">
681  
-					<xsl:value-of select="@added"/>
682  
-				</a>)</strong>
683  
-			</xsl:when>
684  
-			<xsl:otherwise>
685  
-				<strong>(added <xsl:value-of select="@added"/>)</strong>
686  
-			</xsl:otherwise>
687  
-		</xsl:choose>
688  
-	</xsl:if>
689  
-	<xsl:if test="@deprecated">
690  
-		<xsl:text> </xsl:text>
691  
-		<xsl:choose>
692  
-			<xsl:when test="$version-category-links">
693  
-				<strong>(deprecated <a href="/category/version/{@deprecated}/">
694  
-					<xsl:value-of select="@deprecated"/>
695  
-				</a>)</strong>
696  
-			</xsl:when>
697  
-			<xsl:otherwise>
698  
-				<strong>(deprecated <xsl:value-of select="@deprecated"/>)</strong>
699  
-			</xsl:otherwise>
700  
-		</xsl:choose>
701  
-	</xsl:if>
702  
-	<xsl:if test="@removed">
703  
-		<xsl:text> </xsl:text>
704  
-		<xsl:choose>
705  
-			<xsl:when test="$version-category-links">
706  
-				<strong>(removed <a href="/category/version/{@removed}/">
707  
-					<xsl:value-of select="@removed"/>
708  
-				</a>)</strong>
709  
-			</xsl:when>
710  
-			<xsl:otherwise>
711  
-				<strong>(removed <xsl:value-of select="@removed"/>)</strong>
712  
-			</xsl:otherwise>
713  
-		</xsl:choose>
714  
-	</xsl:if>
715  
-</xsl:template>
716  
-
717  
-<xsl:template name="widget-method-event">
718  
-	<xsl:param name="entry-name"/>
719  
-	<xsl:param name="method-name"/>
720  
-
721  
-	<h3>
722  
-		<xsl:call-template name="method-signature">
723  
-			<xsl:with-param name="method-name" select="$method-name"/>
724  
-		</xsl:call-template>
725  
-		<xsl:call-template name="return-value"/>
726  
-	</h3>
727  
-	<div>
728  
-		<xsl:apply-templates select="desc">
729  
-			<xsl:with-param name="entry-name" select="$entry-name"/>
730  
-		</xsl:apply-templates>
731  
-		<xsl:call-template name="version-details"/>
732  
-	</div>
733  
-	<xsl:call-template name="arguments"/>
734  
-</xsl:template>
735  
-
736  
-<!-- <desc> and <longdesc> support <placeholder name="foo"> to replace the
737  
-placeholder with @foo from the <entry> -->
738  
-<xsl:template match="desc|longdesc">
739  
-	<xsl:param name="entry-name"/>
740  
-	<xsl:apply-templates select="./node()">
741  
-		<xsl:with-param name="entry-name" select="$entry-name"/>
742  
-	</xsl:apply-templates>
743  
-</xsl:template>
744  
-<!-- This makes elements and attributes get copied over properly -->
745  
-<xsl:template match="desc//*|desc//@*|longdesc//*|longdesc//@*">
746  
-	<xsl:copy>
747  
-		<xsl:apply-templates select="@* | node()"/>
748  
-	</xsl:copy>
749  
-</xsl:template>
750  
-<!-- <xi:include> will add an xml:base attribute, so we strip it out -->
751  
-<xsl:template match="//@xml:base"/>
752  
-<!-- replace the <placeholder> with the associated attribute from the entry -->
753  
-<xsl:template match="//placeholder">
754  
-	<xsl:variable name="name" select="@name"/>
755  
-	<xsl:value-of select="ancestor::entry/@*[name()=$name]"/>
756  
-</xsl:template>
757  
-
758  
-<!-- escape-string, from xml2json.xsl -->
759  
-<xsl:template name="escape-string"><xsl:param name="s"/><xsl:text>"</xsl:text><xsl:call-template name="escape-bs-string"><xsl:with-param name="s" select="$s"/></xsl:call-template><xsl:text>"</xsl:text></xsl:template><xsl:template name="escape-bs-string"><xsl:param name="s"/><xsl:choose><xsl:when test="contains($s,'\')"><xsl:call-template name="escape-quot-string"><xsl:with-param name="s" select="concat(substring-before($s,'\'),'\\')"/></xsl:call-template><xsl:call-template name="escape-bs-string"><xsl:with-param name="s" select="substring-after($s,'\')"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:call-template name="escape-quot-string"><xsl:with-param name="s" select="$s"/></xsl:call-template></xsl:otherwise></xsl:choose></xsl:template><xsl:template name="escape-quot-string"><xsl:param name="s"/><xsl:choose><xsl:when test="contains($s,'&quot;')"><xsl:call-template name="encode-string"><xsl:with-param name="s" select="concat(substring-before($s,'&quot;'),'\&quot;')"/></xsl:call-template><xsl:call-template name="escape-quot-string"><xsl:with-param name="s" select="substring-after($s,'&quot;')"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:call-template name="encode-string"><xsl:with-param name="s" select="$s"/></xsl:call-template></xsl:otherwise></xsl:choose></xsl:template><xsl:template name="encode-string"><xsl:param name="s"/><xsl:choose><!-- tab --><xsl:when test="contains($s,'&#x9;')"><xsl:call-template name="encode-string"><xsl:with-param name="s" select="concat(substring-before($s,'&#x9;'),'\t',substring-after($s,'&#x9;'))"/></xsl:call-template></xsl:when><!-- line feed --><xsl:when test="contains($s,'&#xA;')"><xsl:call-template name="encode-string"><xsl:with-param name="s" select="concat(substring-before($s,'&#xA;'),'\n',substring-after($s,'&#xA;'))"/></xsl:call-template></xsl:when><!-- carriage return --><xsl:when test="contains($s,'&#xD;')"><xsl:call-template name="encode-string"><xsl:with-param name="s" select="concat(substring-before($s,'&#xD;'),'\r',substring-after($s,'&#xD;'))"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:value-of select="$s"/></xsl:otherwise></xsl:choose></xsl:template>
760  
-
761  
-</xsl:stylesheet>
2  entries2html.xsl
... ...
@@ -1,6 +1,6 @@
1 1
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
2 2
 
3  
-<xsl:import href="entries2html-base.xsl"/>
  3
+<xsl:import href="node_modules/grunt-jquery-content/tasks/jquery-xml/entries2html-base.xsl"/>
4 4
 <xsl:import href="notes.xsl"/>
5 5
 
6 6
 <xsl:template name="example-code">
10  grunt.js
@@ -13,13 +13,8 @@ grunt.initConfig({
13 13
 	lint: {
14 14
 		grunt: "grunt.js"
15 15
 	},
16  
-	// TODO would be useful, but throws broken exceptions when a change is detected
17  
-	watch: {
18  
-		files: "entries/**",
19  
-		tasks: "grunt deploy"
20  
-	},
21 16
 	xmllint: {
22  
-		all: [].concat( entryFiles, "cat2tax.xsl", "categories.xml", "entries2html.xsl", "xml2json.xsl" )
  17
+		all: [].concat( entryFiles, "categories.xml", "entries2html.xsl", "notes.xsl" )
23 18
 	},
24 19
 	xmltidy: {
25 20
 		all: [].concat( entryFiles, "categories.xml" )
@@ -39,7 +34,8 @@ grunt.initConfig({
39 34
 });
40 35
 
41 36
 grunt.registerTask( "default", "build-wordpress" );
42  
-grunt.registerTask( "build-wordpress", "clean lint xmllint build-pages build-xml-entries build-xml-categories build-resources" );
  37
+grunt.registerTask( "build", "build-pages build-xml-entries build-xml-categories build-resources build-xml-full" );
  38
+grunt.registerTask( "build-wordpress", "clean lint xmllint build" );
43 39
 grunt.registerTask( "tidy", "xmllint xmltidy" );
44 40
 
45 41
 };
2  package.json
@@ -24,7 +24,7 @@
24 24
     "grunt": "0.3.x",
25 25
     "grunt-clean": "0.3.0",
26 26
     "grunt-wordpress": "1.0.3",
27  
-    "grunt-jquery-content": "0.4.x"
  27
+    "grunt-jquery-content": "0.5.x"
28 28
   },
29 29
   "devDependencies": {},
30 30
   "keywords": []
10  preproc-xinclude.xsl
... ...
@@ -1,10 +0,0 @@
1  
-<?xml version="1.0"?>
2  
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3  
-	<!-- IdentityTransform -->
4  
-	<!-- For more info, see http://www.usingxml.com/Transforms/XslIdentity or google 'identity xsl' -->
5  
-	<xsl:template match="/ | @* | node()">
6  
-		<xsl:copy>
7  
-			<xsl:apply-templates select="@* | node()"/>
8  
-		</xsl:copy>
9  
-	</xsl:template>
10  
-</xsl:stylesheet>
183  xml2json.xsl
... ...
@@ -1,183 +0,0 @@
1  
-<?xml version="1.0" encoding="UTF-8"?>
2  
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3  
-<!--
4  
-  Copyright (c) 2006, Doeke Zanstra
5  
-  All rights reserved.
6  
-
7  
-  Note: This is a hacked version of xml2json.xslt
8  
-  ****  All numbers will be output as strings to prevent version numbers like
9  
-  ****  1.0 changing to 1
10  
-  ****  If you want the original version, get it from
11  
-  ****  http://code.google.com/p/xml2json-xslt/
12  
-
13  
-  Redistribution and use in source and binary forms, with or without modification, 
14  
-  are permitted provided that the following conditions are met:
15  
-
16  
-  Redistributions of source code must retain the above copyright notice, this 
17  
-  list of conditions and the following disclaimer. Redistributions in binary 
18  
-  form must reproduce the above copyright notice, this list of conditions and the 
19  
-  following disclaimer in the documentation and/or other materials provided with 
20  
-  the distribution.
21  
-
22  
-  Neither the name of the dzLib nor the names of its contributors may be used to 
23  
-  endorse or promote products derived from this software without specific prior 
24  
-  written permission.
25  
-
26  
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
27  
-  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
28  
-  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
29  
-  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
30  
-  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
31  
-  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
32  
-  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
33  
-  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
34  
-  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
35  
-  THE POSSIBILITY OF SUCH DAMAGE.
36  
--->
37  
-
38  
-  <xsl:output indent="no" omit-xml-declaration="yes" method="text" encoding="UTF-8" media-type="text/x-json"/>
39  
-	<xsl:strip-space elements="*"/>
40  
-  <!--contant-->
41  
-  <xsl:variable name="d">0123456789</xsl:variable>
42  
-
43  
-  <!-- ignore document text -->
44  
-  <xsl:template match="text()[preceding-sibling::node() or following-sibling::node()]"/>
45  
-
46  
-  <!-- string -->
47  
-  <xsl:template match="text()">
48  
-    <xsl:call-template name="escape-string">
49  
-      <xsl:with-param name="s" select="."/>
50  
-    </xsl:call-template>
51  
-  </xsl:template>
52  
-  
53  
-  <!-- Main template for escaping strings; used by above template and for object-properties 
54  
-       Responsibilities: placed quotes around string, and chain up to next filter, escape-bs-string -->
55  
-  <xsl:template name="escape-string">
56  
-    <xsl:param name="s"/>
57  
-    <xsl:text>"</xsl:text>
58  
-    <xsl:call-template name="escape-bs-string">
59  
-      <xsl:with-param name="s" select="$s"/>
60  
-    </xsl:call-template>
61  
-    <xsl:text>"</xsl:text>
62  
-  </xsl:template>
63  
-  
64  
-  <!-- Escape the backslash (\) before everything else. -->
65  
-  <xsl:template name="escape-bs-string">
66  
-    <xsl:param name="s"/>
67  
-    <xsl:choose>
68  
-      <xsl:when test="contains($s,'\')">
69  
-        <xsl:call-template name="escape-quot-string">
70  
-          <xsl:with-param name="s" select="concat(substring-before($s,'\'),'\\')"/>
71  
-        </xsl:call-template>
72  
-        <xsl:call-template name="escape-bs-string">
73  
-          <xsl:with-param name="s" select="substring-after($s,'\')"/>
74  
-        </xsl:call-template>
75  
-      </xsl:when>
76  
-      <xsl:otherwise>
77  
-        <xsl:call-template name="escape-quot-string">
78  
-          <xsl:with-param name="s" select="$s"/>
79  
-        </xsl:call-template>
80  
-      </xsl:otherwise>
81  
-    </xsl:choose>
82  
-  </xsl:template>
83  
-  
84  
-  <!-- Escape the double quote ("). -->
85  
-  <xsl:template name="escape-quot-string">
86  
-    <xsl:param name="s"/>
87  
-    <xsl:choose>
88  
-      <xsl:when test="contains($s,'&quot;')">
89  
-        <xsl:call-template name="encode-string">
90  
-          <xsl:with-param name="s" select="concat(substring-before($s,'&quot;'),'\&quot;')"/>
91  
-        </xsl:call-template>
92  
-        <xsl:call-template name="escape-quot-string">
93  
-          <xsl:with-param name="s" select="substring-after($s,'&quot;')"/>
94  
-        </xsl:call-template>
95  
-      </xsl:when>
96  
-      <xsl:otherwise>
97  
-        <xsl:call-template name="encode-string">
98  
-          <xsl:with-param name="s" select="$s"/>
99  
-        </xsl:call-template>
100  
-      </xsl:otherwise>
101  
-    </xsl:choose>
102  
-  </xsl:template>
103  
-  
104  
-  <!-- Replace tab, line feed and/or carriage return by its matching escape code. Can't escape backslash
105  
-       or double quote here, because they don't replace characters (&#x0; becomes \t), but they prefix 
106  
-       characters (\ becomes \\). Besides, backslash should be seperate anyway, because it should be 
107  
-       processed first. This function can't do that. -->
108  
-  <xsl:template name="encode-string">
109  
-    <xsl:param name="s"/>
110  
-    <xsl:choose>
111  
-      <!-- tab -->
112  
-      <xsl:when test="contains($s,'&#x9;')">
113  
-        <xsl:call-template name="encode-string">
114  
-          <xsl:with-param name="s" select="concat(substring-before($s,'&#x9;'),'\t',substring-after($s,'&#x9;'))"/>
115  
-        </xsl:call-template>
116  
-      </xsl:when>
117  
-      <!-- line feed -->
118  
-      <xsl:when test="contains($s,'&#xA;')">
119  
-        <xsl:call-template name="encode-string">
120  
-          <xsl:with-param name="s" select="concat(substring-before($s,'&#xA;'),'\n',substring-after($s,'&#xA;'))"/>
121  
-        </xsl:call-template>
122  
-      </xsl:when>
123  
-      <!-- carriage return -->
124  
-      <xsl:when test="contains($s,'&#xD;')">
125  
-        <xsl:call-template name="encode-string">
126  
-          <xsl:with-param name="s" select="concat(substring-before($s,'&#xD;'),'\r',substring-after($s,'&#xD;'))"/>
127  
-        </xsl:call-template>
128  
-      </xsl:when>
129  
-      <xsl:otherwise><xsl:value-of select="$s"/></xsl:otherwise>
130  
-    </xsl:choose>
131  
-  </xsl:template>
132  
-
133  
-  <!-- number (no support for javascript mantise) -->
134  
-  <xsl:template match="text()[not(string(number())='NaN')]">
135  
-    &quot;<xsl:value-of select="."/>&quot;
136  
-  </xsl:template>
137  
-
138  
-  <!-- boolean, case-insensitive -->
139  
-  <xsl:template match="text()[translate(.,'TRUE','true')='true']">true</xsl:template>
140  
-  <xsl:template match="text()[translate(.,'FALSE','false')='false']">false</xsl:template>
141  
-
142  
-  <!-- item:null -->
143  
-  <xsl:template match="*[count(child::node())=0]">
144  
-    <xsl:call-template name="escape-string">
145  
-      <xsl:with-param name="s" select="local-name()"/>
146  
-    </xsl:call-template>
147  
-    <xsl:text>:null</xsl:text>
148  
-    <xsl:if test="following-sibling::*">,</xsl:if>
149  
-  </xsl:template>
150  
-
151  
-  <!-- object -->
152  
-  <xsl:template match="*" name="base">
153  
-    <xsl:if test="not(preceding-sibling::*)">{</xsl:if>
154  
-    <xsl:call-template name="escape-string">
155  
-      <xsl:with-param name="s" select="name()"/>
156  
-    </xsl:call-template>
157  
-    <xsl:text>:</xsl:text>
158  
-    <xsl:apply-templates select="child::node()"/>
159  
-    <xsl:if test="following-sibling::*">,</xsl:if>
160  
-    <xsl:if test="not(following-sibling::*)">}</xsl:if>
161  
-  </xsl:template>
162  
-
163  
-  <!-- array -->
164  
-  <xsl:template match="*[count(../*[name(../*)=name(.)])=count(../*) and count(../*)&gt;1]">
165  
-    <xsl:if test="not(preceding-sibling::*)">[</xsl:if>
166  
-    <xsl:choose>
167  
-      <xsl:when test="not(child::node())">
168  
-        <xsl:text>null</xsl:text>
169  
-      </xsl:when>
170  
-      <xsl:otherwise>
171  
-        <xsl:apply-templates select="child::node()"/>
172  
-      </xsl:otherwise>
173  
-    </xsl:choose>
174  
-    <xsl:if test="following-sibling::*">,</xsl:if>
175  
-    <xsl:if test="not(following-sibling::*)">]</xsl:if>
176  
-  </xsl:template>
177  
-  
178  
-  <!-- convert root element to an anonymous container -->
179  
-  <xsl:template match="/">
180  
-    <xsl:apply-templates select="node()"/>
181  
-  </xsl:template>
182  
-    
183  
-</xsl:stylesheet>

0 notes on commit 0ccfc19

Please sign in to comment.
Something went wrong with that request. Please try again.