-
Notifications
You must be signed in to change notification settings - Fork 6
/
11_poster_relaxed_empty.html
123 lines (106 loc) · 4.05 KB
/
11_poster_relaxed_empty.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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Yihui Xie" />
<meta name="date" content="2019-02-23" />
<title>An HTML poster example</title>
<link href="11_poster_relaxed_empty_files/paged-0.1.4/css/poster-relaxed.css" rel="stylesheet" />
</head>
<body>
<div id="presentation-ninja-with-r-and-xaringan" class="section level1">
<h1>Presentation Ninja <span class="tiny">with</span> R and xaringan</h1>
</div>
<div id="authors" class="section level1">
<h1><span class="red">Authors</span></h1>
</div>
<div id="motivation" class="section level1">
<h1><span class="blue">Motivation</span></h1>
</div>
<div id="schedule" class="section level1">
<h1><span class="pink">Schedule</span></h1>
</div>
<div id="contents" class="section level1">
<h1><span class="green">Contents</span></h1>
</div>
<div id="bibliography" class="section level1">
<h1><span class="yellow">Bibliography</span></h1>
</div>
<script type="text/javascript">
(function() {
// add appropriate classes to h1 and its parent div
var i, j, d, s, el, els = document.getElementsByTagName('h1');
for (i = 0; i < els.length; i++) {
el = els[i];
el.parentNode.className += ' section-' + (i + 1);
if (i === 0) continue; // that's all we need for the poster title
el.className += ' ui title ribbon label'; // poster sections
s = el.firstElementChild; // move the class from inner <span> to <h1>
if (s) {
el.className += ' ' + s.className;
s.outerHTML = s.innerHTML;
}
el.parentNode.className += ' ui raised segment';
// wrap everything except the h1 in a section into <div class="content">
d = document.createElement('div');
d.className = 'content';
while (el.nextSibling) {
d.append(el.nextSibling);
}
el.parentNode.append(d);
}
// turn h2 sections in <div class="member-cards"> into semantic ui's cards
els = document.querySelectorAll('.member-cards');
for (i = 0; i < els.length; i++) {
el = els[i].querySelectorAll('h2');
for (j = 0; j < el.length; j++) {
s = el[j];
d = document.createElement('div');
d.className = 'ui card';
d.innerHTML = '<div class="image"></div><div class="content">' +
'<div class="header"></div><div class="meta"></div>' +
'<div class="description"></div></div>'
d.firstChild.innerHTML = s.nextElementSibling.querySelector('img').outerHTML;
s.parentNode.removeChild(s.nextElementSibling);
d.lastChild.children[0].innerHTML = s.innerHTML;
d.lastChild.children[1].innerHTML = s.nextElementSibling.innerHTML;
s.parentNode.removeChild(s.nextElementSibling);
d.lastChild.children[2].innerHTML = s.nextElementSibling.innerHTML;
s.parentNode.removeChild(s.nextElementSibling);
s.parentNode.replaceChild(d, s);
}
}
// remove the section divs for h2 - h5
els = document.querySelectorAll('h2, h3, h4, h5');
for (i = 0; i < els.length; i++) {
el = els[i].parentNode;
if (el && el.tagName === 'DIV' && /section level/.test(el.className)) {
el.outerHTML = el.innerHTML;
}
}
// replace <p><span class="foo">bar</span></p> with <div class="foo">bar</div>
els = document.getElementsByTagName('p');
for (i = 0; i < els.length;) {
el = els[i]; i++;
if (el.childElementCount !== 1) continue;
s = el.firstElementChild;
if (s.tagName !== 'SPAN' || s.outerHTML !== el.innerHTML) continue;
d = document.createElement('div');
d.innerHTML = s.innerHTML;
d.className = s.className;
el.parentNode.replaceChild(d, el);
i--;
}
// break words in <a> if the text and uri are identical
els = document.getElementsByTagName('a');
for (i = 0; i < els.length; i++) {
el = els[i];
if (el.getAttribute('href') === el.innerText) el.style.wordBreak = 'break-all';
}
})();
</script>
</body>
</html>