-
Notifications
You must be signed in to change notification settings - Fork 5
/
presenter-notes.xsl
67 lines (58 loc) · 1.93 KB
/
presenter-notes.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings"
xmlns:func="http://exslt.org/functions"
xmlns:exsl="http://exslt.org/common"
xmlns:sfa="http://developer.apple.com/namespaces/sfa"
xmlns:sf="http://developer.apple.com/namespaces/sf"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:key="http://developer.apple.com/namespaces/keynote2"
extension-element-prefixes="str exsl func">
<!--
unzip -p blitz-example.key index.apxl | xsltproc presenter-notes.xsl -
-->
<xsl:output method="xml" indent="yes" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
<xsl:template match="key:presentation">
<html xml:lang="en-US" lang="en-US">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!-- default all the speaker notes to hidden and positioned atop each other -->
<style type="text/css">
div.slide {
position:absolute;
display:none;
}
p:first-child {
margin-top:0;
}
</style>
<script type="text/javascript">
<![CDATA[
function displayNotesForSlide(visibleIndex) {
slideNotes = document.body.getElementsByClassName("slide")
for (slideIndex = 0; slideNotes[slideIndex]; slideIndex++) {
slide = slideNotes[slideIndex]
if (slideIndex == visibleIndex) {
slide.style.display = 'block'
} else {
slide.style.display = 'none'
}
}
return slideNotes
}
]]>
</script>
</head>
<body>
<xsl:for-each select="key:slide-list/key:slide">
<div class="slide">
<xsl:for-each select="key:notes/sf:text-storage/sf:text-body/sf:p">
<p><xsl:value-of select="text()"/></p>
</xsl:for-each>
</div>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>