-
Notifications
You must be signed in to change notification settings - Fork 0
/
Meetings.Rmd
80 lines (70 loc) · 2.15 KB
/
Meetings.Rmd
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
---
title: "Past Meetings"
output:
distill::distill_article:
self_contained: false
theme: meetings.css
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
```{r eval=FALSE}
# Run locally
options(
gargle_oauth_cache = ".secrets",
gargle_oauth_email = "[email protected]"
)
googledrive::drive_deauth()
googledrive::drive_auth(scopes = "https://www.googleapis.com/auth/drive.readonly", email="[email protected]")
```
```{r eval=FALSE}
# Run locally
url_googledrive <- "https://drive.google.com/drive/folders/1-6gO6uw4Rm_Hx-DdlsoBmR00OdKHsgQm"
dir_files <- googledrive::drive_ls(path = url_googledrive, type="spreadsheet")
file_name <- "MeetingList"
file_id <- dir_files$id[which(dir_files$name==file_name)]
googledrive::drive_download(file=file_id,
overwrite = TRUE,
type = "csv",
path = file.path("data", file_name))
```
```{r include=FALSE}
tmp <- read.csv(file.path("data", "MeetingList.csv"))
nm <- c("Video", "repo", "Notes", "Slides")
clnm <- c("video", "repo", "notes", "slides")
for(i in 1:4){
nolink <- tmp[[clnm[i]]] == ""
tmp[[clnm[i]]] <- paste0("[", nm[i], "](", tmp[[clnm[i]]], ")")
tmp[[clnm[i]]][nolink] <- ""
}
tmp <- tmp[order(as.Date(tmp$date, "%b %d, %Y"), decreasing=TRUE),]
```
<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search the description" title="Type search text">
<div id="myTable">
```{r}
require(kableExtra)
kable_styling(kbl(tmp, row.names=FALSE), bootstrap_options = c("striped", "hover"))
```
</div>
```{=html}
<script>
function myFunction() {
var input, filter, table, tr, td, i, txtValue;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
table = document.getElementById("myTable");
tr = table.getElementsByTagName("tr");
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[1];
if (td) {
txtValue = td.textContent || td.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
</script>
```