-
Notifications
You must be signed in to change notification settings - Fork 0
/
materials.qmd
89 lines (72 loc) · 2.12 KB
/
materials.qmd
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
---
title: "Materials"
date: 04/12/2024
engine: knitr
categories: BDSI Workshop
format:
html:
css:
- assets/webex.css
- assets/custom.css
include-after-body:
- assets/webex.js
filters:
- webr2
webr:
show-startup-message: false
---
[![](images/by-nc-sa.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en)
```{r setup, include = FALSE}
library(webexercises)
library(lubridate)
library(tidyverse)
ex_tabset <- function(id) {
paste0("[_Exercise ", id, "_](#tabset-1-", id, "-tab){onclick=",
'document.getElementById(', "'tabset-1-", id, "-tab').click();",
'}')
}
slide_title <- function(id) {
paste0("[",
rmarkdown::yaml_front_matter(paste0("slides/slide", id, ".qmd"))$title,
"](slides/slide", id, ".html){target='_blank'}")
}
LOs <- readLines("slides/_learning-objectives.qmd")
LOs <- LOs[LOs!=""]
LOs <- stringr::str_replace(LOs, "- ", "")
checklist <- function(x) {
paste0("::: {.callout-note}\n\n",
"## Reflect on learning objectives \n\n",
"You should be able to:\n",
paste0("<ul class='checkbox'>", paste(paste0("<li><input type='checkbox'> ", x, "</li>"), collapse = "\n\n"), "</ul>\n\n:::"))
}
start <- dmy_hms("03/04/2024 10.00.00")
timedisplay <- function(duration) {
end <- start + duration(duration, units = "minutes")
ret <- paste0(format(start, "%H:%M"), "--", format(end, "%H:%M"))
start <<- end
ret
}
content <- read_csv("slides/data/content.csv")
```
## 🕙 Schedule
```{r}
#| echo: false
content |>
rowwise() |>
mutate(Time = timedisplay(time)) |>
mutate(Content = switch(type,
"exercise" = ex_tabset(content_id),
"slide" = slide_title(content_id),
type)) |>
select(Time, Content) |>
knitr::kable()
```
## 📑 Resources
- The best guide is the [Quarto documentation website](https://quarto.org/docs/guide/).
## 🔎 Files
```{r}
#| echo: false
#| results: asis
fns <- dir(path = "exercises", pattern = "[.]qmd$")[-1]
cat(paste0("- <a href='exercises/", fns, "' download>", fns, "</a>"), sep = "\n")
```