-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.html~
More file actions
80 lines (65 loc) · 1.79 KB
/
index.html~
File metadata and controls
80 lines (65 loc) · 1.79 KB
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
<!DOCTYPE html>
<html>
<title>Московский государственный технический университет им. Н.Э.Баумана, 19 ноября - 10 декабря 2016</title>
<meta charset="utf-8">
<style>
img {
display: block;
margin: 0 auto !important;
max-width: 600px !important;
max-height: 400px !important;
}
img + strong {
display: block;
text-align: center;
}
</style>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<script>
// Просто список всех markdown-файлов.
var include = [
'00-info',
'10-introduce',
'20-arduino',
'30-raspberry',
'40-webclient',
'35-tizen',
'appendix'
];
// Подключить только указанный (иначе все).
var includeOnly = '';
// Тема. Пока стандартная.
var theme = '';
</script>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<script>
function download(files, done) {
var downloaded = 0;
var result = [];
files.forEach(function(file, i) {
var req = new XMLHttpRequest();
req.overrideMimeType('text/plain');
req.onload = function() {
result[i] = req.responseText;
if (++downloaded === files.length)
done(result.join('\n'));
};
req.open('GET', file + '.md', true);
req.send();
});
}
function render(theme, data) {
var xmp = document.createElement('xmp');
xmp.setAttribute('theme', theme);
xmp.style = 'display:none';
xmp.appendChild(document.createTextNode(data));
document.body.appendChild(xmp);
var script = document.createElement('script');
script.src = 'https://strapdownjs.com/v/0.2/strapdown.js';
document.body.appendChild(script);
}
window.onload = function() {
download(includeOnly ? [includeOnly] : include, render.bind(null, theme));
};
</script>
</html>