-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathautoreload.html
41 lines (36 loc) · 1012 Bytes
/
autoreload.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
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<script src="vendor/highlight.pack.js"></script>
<script src="vendor/remark-latest.min.js"></script>
<script src="vendor/jquery-2.1.1.min.js"></script>
<script>
var source = "";
var url = "slides.md";
var slideshow = null;
function autoUpdate() {
jQuery.get(url, function(data) {
if (source !== data) {
window.location.reload();
}
});
}
jQuery.get(url, function(data) {
source = data;
slideshow = remark.create({
source: data,
highlightLanguage: "",
});
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});
setInterval(autoUpdate, 1000);
});
</script>
</body>
</html>