-
Notifications
You must be signed in to change notification settings - Fork 73
/
entries2html.xsl
40 lines (35 loc) · 1.39 KB
/
entries2html.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="node_modules/grunt-jquery-content/tasks/jquery-xml/entries2html-base.xsl"/>
<xsl:import href="notes.xsl"/>
<xsl:template name="example-code">
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><xsl:value-of select="//entry/@name"/> demo</title>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.3/themes/smoothness/jquery-ui.css"><xsl:if test="css">
<style><xsl:value-of select="css/text()"/> </style></xsl:if>
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script src="https://code.jquery.com/ui/1.13.3/jquery-ui.js"></script>
</head>
<body>
<xsl:value-of select="html/text()"/>
<script><xsl:value-of select="code/text()"/></script>
</body>
</html>
</xsl:template>
<!-- <template name="core-link"/> will generate a link to the documentation for
the method of the same name from jQuery core -->
<xsl:template match="//placeholder[@name = 'core-link']">
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat('//api.jquery.com/', ancestor::entry/@name, '/')"/>
</xsl:attribute>
<code>
<xsl:text>.</xsl:text>
<xsl:value-of select="ancestor::entry/@name"/>
<xsl:text>()</xsl:text>
</code>
</a>
</xsl:template>
</xsl:stylesheet>