-
Notifications
You must be signed in to change notification settings - Fork 9
/
slides.html
236 lines (203 loc) · 8.38 KB
/
slides.html
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>这是标题</title>
<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/sky.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- For Customized Design-->
<link rel="stylesheet" href="css/custom.css">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
<script type="text/javascript">/*<![CDATA[*/
/*
March 19, 2004 MathHTML (c) Peter Jipsen http://www.chapman.edu/~jipsen
Released under the GNU General Public License version 2 or later.
See the GNU General Public License (at http://www.gnu.org/copyleft/gpl.html)
for more details.
*/
function convertMath(node) {// for Gecko
if (node.nodeType==1) {
var newnode =
document.createElementNS("http://www.w3.org/1998/Math/MathML",
node.nodeName.toLowerCase());
for(var i=0; i < node.attributes.length; i++)
newnode.setAttribute(node.attributes[i].nodeName,
node.attributes[i].nodeValue);
for (var i=0; i<node.childNodes.length; i++) {
var st = node.childNodes[i].nodeValue;
if (st==null || st.slice(0,1)!=" " && st.slice(0,1)!="\n")
newnode.appendChild(convertMath(node.childNodes[i]));
}
return newnode;
}
else return node;
}
function convert() {
var mmlnode = document.getElementsByTagName("math");
var st,str,node,newnode;
for (var i=0; i<mmlnode.length; i++)
if (document.createElementNS!=null)
mmlnode[i].parentNode.replaceChild(convertMath(mmlnode[i]),mmlnode[i]);
else { // convert for IE
str = "";
node = mmlnode[i];
while (node.nodeName!="/MATH") {
st = node.nodeName.toLowerCase();
if (st=="#text") str += node.nodeValue;
else {
str += (st.slice(0,1)=="/" ? "</m:"+st.slice(1) : "<m:"+st);
if (st.slice(0,1)!="/")
for(var j=0; j < node.attributes.length; j++)
if (node.attributes[j].nodeValue!="italic" &&
node.attributes[j].nodeValue!="" &&
node.attributes[j].nodeValue!="inherit" &&
node.attributes[j].nodeValue!=undefined)
str += " "+node.attributes[j].nodeName+"="+
"\""+node.attributes[j].nodeValue+"\"";
str += ">";
}
node = node.nextSibling;
node.parentNode.removeChild(node.previousSibling);
}
str += "</m:math>";
newnode = document.createElement("span");
node.parentNode.replaceChild(newnode,node);
newnode.innerHTML = str;
}
}
if (document.createElementNS==null) {
document.write("<object id=\"mathplayer\"\
classid=\"clsid:32F66A20-7614-11D4-BD11-00104BD3F987\"></object>");
document.write("<?import namespace=\"m\" implementation=\"#mathplayer\"?>");
}
if(typeof window.addEventListener != 'undefined'){
window.addEventListener('load', convert, false);
}
if(typeof window.attachEvent != 'undefined') {
window.attachEvent('onload', convert);
}
/*]]>*/
</script>
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h1>这是标题</h1>
<h3>作者姓名</h3>
<p>
<h4>日期</h4>
</p>
</section>
<section id="第一张幻灯片" class="level2">
<h2>第一张幻灯片</h2>
<p>可以支持中文。请看列表</p>
<ul>
<li>第一项</li>
<li>第二项
<ul>
<li><a href="http://google.com">Google</a></li>
<li>还可以在<a href="http://rvl.io">http://rvl.io</a>上在线编辑slides</li>
</ul></li>
<li>第三项 数学公式 <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mfrac><msup><mi>x</mi><mn>2</mn></msup><mn>2</mn></mfrac></mrow></math></li>
</ul>
</section>
<section id="第二张幻灯片" class="level2">
<h2>第二张幻灯片</h2>
<p>尝试逐项出现条目</p>
<ul>
<li class="fragment">
第一项
</li>
<li class="fragment">
第二项
</li>
</ul>
</section>
<section id="section" class="level2">
<h2></h2>
<p>可以没有标题</p>
<figure>
<img src="fig/html5.png" alt="图片说明" /><figcaption>图片说明</figcaption>
</figure>
</section>
<section id="表格" class="level2">
<h2>表格</h2>
<table>
<thead>
<tr class="header">
<th style="text-align: left;">name</th>
<th style="text-align: left;">type</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">张三</td>
<td style="text-align: left;">好人</td>
</tr>
<tr class="even">
<td style="text-align: left;">李四</td>
<td style="text-align: left;">坏人</td>
</tr>
</tbody>
</table>
<p>表格的样式我放在/css/custom.css里了</p>
</section>
<section id="变量" class="level2">
<h2>变量</h2>
<p>下面两个是可以在命令行中定义的变量</p>
<ul>
<li>theme</li>
<li>transition</li>
</ul>
<p>以linux下的shell脚步为例:</p>
<pre class="sourceCode bash"><code class="sourceCode bash"><span class="kw">pandoc</span> -t html5 --template=template-revealjs.html \
<span class="kw">--standalone</span> --section-divs \
<span class="kw">--variable</span> theme=<span class="st">"beige"</span> \
<span class="kw">--variable</span> transition=<span class="st">"linear"</span> \
<span class="kw">slides.md</span> -o slides.html</code></pre>
<p>windows下的情况请看本项目repo中的<a href="https://github.com/yanping/reveal.js-with-pandoc/blob/gh-pages/build.bat">bat文件</a></p>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
theme: Reveal.getQueryHash().theme || "sky" , // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || "cube", // default/cube/page/concave/zoom/linear/fade/none
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
// { src: 'plugin/search/search.js', async: true, condition: function() { return !!document.body.classList; } }
// { src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
</body>
</html>