-
Notifications
You must be signed in to change notification settings - Fork 22
/
extras.html
290 lines (254 loc) · 9.35 KB
/
extras.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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
<!DOCTYPE html>
<html lang="" xml:lang="">
<head>
<title>Extra Bits</title>
<meta charset="utf-8" />
<meta name="author" content="Garrick Aden-Buie" />
<meta name="date" content="2020-01-27" />
<link href="assets/libs/tile-view/tile-view.css" rel="stylesheet" />
<script src="assets/libs/tile-view/tile-view.js"></script>
<link href="assets/libs/animate.css/animate.xaringan.css" rel="stylesheet" />
<link href="assets/libs/js4shiny/css/_variables-fonts.css" rel="stylesheet" />
<link href="assets/libs/js4shiny/css/_variables.css" rel="stylesheet" />
<link href="assets/libs/js4shiny/css/code.css" rel="stylesheet" />
<link href="assets/libs/js4shiny/jsonview/jsonview.css" rel="stylesheet" />
<script src="assets/libs/js4shiny/jsonview/jsonview.min.js"></script>
<link href="assets/libs/js4shiny-redirectConsoleLog/jslog.css" rel="stylesheet" />
<script src="assets/libs/js4shiny-redirectConsoleLog/redirectConsoleLog.js"></script>
<meta name="description" content="Slides for "Anthology" from the "JavaScript for Shiny Users" workshop at rstudio::conf(2020)"/>
<meta name="twitter:title" content="Anthology | JavaScript for Shiny Users"/>
<meta name="twitter:description" content="Slides for "Anthology" from the "JavaScript for Shiny Users" workshop at rstudio::conf(2020)"/>
<meta name="twitter:url" content="https://js4shiny.com"/>
<meta name="twitter:image:src" content="https://slides.js4shiny.com/assets/img/js4shiny-preview.jpg"/>
<meta name="twitter:image:alt" content="Hex logo of the js4shiny workshop and package"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:creator" content="@grrrck"/>
<meta name="twitter:site" content="@grrrck"/>
<meta name="og:title" content="Anthology | JavaScript for Shiny Users"/>
<meta name="og:description" content="Slides for "Anthology" from the "JavaScript for Shiny Users" workshop at rstudio::conf(2020)"/>
<meta name="og:url" content="https://js4shiny.com"/>
<meta name="og:image" content="https://slides.js4shiny.com/assets/img/js4shiny-preview.jpg"/>
<meta name="og:image:alt" content="Hex logo of the js4shiny workshop and package"/>
<meta name="og:type" content="website"/>
<meta name="og:locale" content="en_US"/>
<meta name="article:author" content="Garrick Aden-Buie"/>
<link rel="stylesheet" href="assets/css/js4shiny-xaringan-base.css" type="text/css" />
<link rel="stylesheet" href="assets/css/tachyons.min.css" type="text/css" />
<link rel="stylesheet" href="assets/css/js4shiny-xaringan-extra.css" type="text/css" />
</head>
<body>
<textarea id="source">
class: title
<h1>Anthology</h1>
<h2>Extra Bits</h2>
<div class="rstudio-conf-logo"></div>
<div class="talk-meta">
<p class="talk-author">Garrick Aden-Buie</p>
<p class="talk-date">rstudio::conf(2020, "JavaScript for Shiny Users")</p>
</div>
---
# Syntax Preview
.flex.flex-wrap[
.w-50[
```r
snake_case <- "awesome"
paste("R is ", snake_case)
```
```
## [1] "R is awesome"
```
]
.w-50[
```js
camelCase = 'cool'
console.log('JS is', camelCase)
```
<div id="out-unnamed-chunk-1"><pre></pre></div>
]
.w-50.mt4[
```html
<h1 id="html-is">Nifty</h1>
<p class="but-css-is">
Radical
</p>
```
]
.w-50.mt4[
```css
#html-is .but-css-is {
color: var(--radical);
}
```
]
]
---
background-image: url(assets/img/coding-cases.png)
background-size: contain
background-position: center center
background-repeat: no-repeat
.footnote[Alison Horst | [github.com/allisonhorst/stats-illustrations](https://github.com/allisonhorst/stats-illustrations/blob/master/other-stats-artwork/coding_cases.png)]
</textarea>
<style data-target="print-only">@media screen {.remark-slide-container{display:block;}.remark-slide-scaler{box-shadow:none;}}</style>
<script src="assets/js/remark-latest.min.js"></script>
<script>var slideshow = remark.create({
"ratio": "16:9",
"slideNumberFormat": "%current%",
"highlightStyle": "docco",
"highlightLines": true,
"countIncrementalSlides": true
});
if (window.HTMLWidgets) slideshow.on('afterShowSlide', function (slide) {
window.dispatchEvent(new Event('resize'));
});
(function(d) {
var s = d.createElement("style"), r = d.querySelector(".remark-slide-scaler");
if (!r) return;
s.type = "text/css"; s.innerHTML = "@page {size: " + r.style.width + " " + r.style.height +"; }";
d.head.appendChild(s);
})(document);
(function(d) {
var el = d.getElementsByClassName("remark-slides-area");
if (!el) return;
var slide, slides = slideshow.getSlides(), els = el[0].children;
for (var i = 1; i < slides.length; i++) {
slide = slides[i];
if (slide.properties.continued === "true" || slide.properties.count === "false") {
els[i - 1].className += ' has-continuation';
}
}
var s = d.createElement("style");
s.type = "text/css"; s.innerHTML = "@media print { .has-continuation { display: none; } }";
d.head.appendChild(s);
})(document);
// delete the temporary CSS (for displaying all slides initially) when the user
// starts to view slides
(function() {
var deleted = false;
slideshow.on('beforeShowSlide', function(slide) {
if (deleted) return;
var sheets = document.styleSheets, node;
for (var i = 0; i < sheets.length; i++) {
node = sheets[i].ownerNode;
if (node.dataset["target"] !== "print-only") continue;
node.parentNode.removeChild(node);
}
deleted = true;
});
})();
// adds .remark-code-has-line-highlighted class to <pre> parent elements
// of code chunks containing highlighted lines with class .remark-code-line-highlighted
(function(d) {
const hlines = d.querySelectorAll('.remark-code-line-highlighted');
const preParents = [];
const findPreParent = function(line, p = 0) {
if (p > 1) return null; // traverse up no further than grandparent
const el = line.parentElement;
return el.tagName === "PRE" ? el : findPreParent(el, ++p);
};
for (let line of hlines) {
let pre = findPreParent(line);
if (pre && !preParents.includes(pre)) preParents.push(pre);
}
preParents.forEach(p => p.classList.add("remark-code-has-line-highlighted"));
})(document);</script>
<!-- scripts from markdown source start -->
<script type="text/javascript">
const log_out_unnamed_chunk_1 = redirectLogger(document.querySelector("#out-unnamed-chunk-1 > pre"))
document.addEventListener("DOMContentLoaded", function() {
log_out_unnamed_chunk_1(`camelCase = 'cool'
console.log('JS is', camelCase)`)
})
</script>
<!-- scripts from markdown source end -->
<script>
(function (d) {
d.addEventListener('DOMContentLoaded', function () {
// find code chunks that get special colors
const langSpecial = ['r', 'js', 'yaml', 'json', 'bash', 'html', 'css']
const codeSpecial = d.querySelectorAll(langSpecial.map(l => 'pre code.' + l))
// find code chunks with highlighted lines
const hlines = d.querySelectorAll('.remark-code-line-highlighted')
const preHLParents = []
const findPreParent = function (line, p = 0) {
if (p > 1) return null // traverse up no further than grandparent
const el = line.parentElement
if (el.tagName === 'PRE') {
return el
} else {
return findPreParent(el, ++p)
}
}
// add the code language to the parent <pre> element
for (const code of codeSpecial) {
const pre = findPreParent(code)
const codeLang = code.className.split(' ').filter(c => langSpecial.includes(c))
pre.classList += ` ${codeLang}`
}
// add remark-code-has-line-highlighted to parent <pre> element
for (const line of hlines) {
const pre = findPreParent(line)
if (pre && !preHLParents.includes(pre)) preHLParents.push(pre)
}
preHLParents.forEach(p => p.classList += ' remark-code-has-line-highlighted')
slideshow.on('afterShowSlide', function (slide) {
replaceIframePlaceholders()
})
replaceIframePlaceholders()
})
})(document)
function replaceIframePlaceholders () {
document
.querySelectorAll('.remark-slides-area .remark-visible div[data-iframe]')
.forEach(el => replaceIframePlaceholder(el))
}
function replaceIframePlaceholder (el) {
const iframe = document.createElement('iframe')
if (el.childNodes) {
el.childNodes.forEach(e => iframe.appendChild(e))
}
iframe.src = el.dataset.src
iframe.classList = el.classList
el.parentElement.replaceChild(iframe, el)
}
</script>
<style>
.remark-code-has-line-highlighted .remark-code-line:not(.remark-code-line-highlighted) {
opacity: 0.4;
}
.remark-code-line-highlighted {
background-color: inherit; /* Override highlight color */
/* font-weight: 500; */
}
/* Line Hover Indicator */
.remark-code-line:hover {
font-weight: bold;
opacity: 1 !important;
}
.remark-code-line:hover:before {
content: "\25B6";
color: #6d7e8a;
position: absolute;
transform: translateX(-1.2em);
animation: hover 0.66s alternate 8 cubic-bezier(0.445, 0.05, 0.55, 0.95);
}
@keyframes hover {
0% {
transform: translateX(-1.2em);
}
100% {
transform: translateX(-0.8em);
}
}
</style>
<script>
(function() {
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
if (/^(https?:)?\/\//.test(links[i].getAttribute('href'))) {
links[i].target = '_blank';
}
}
})();
</script>
</body>
</html>