-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpeople.Rmd
More file actions
125 lines (110 loc) · 3.86 KB
/
people.Rmd
File metadata and controls
125 lines (110 loc) · 3.86 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
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
---
title: "People"
---
## Current R-I Lab members
Please read more information on [joining the lab](prosp.html) and [lab expectations](expectations.html).
```{r people_render, results='asis', echo=FALSE}
people <- read.csv("data/people_current.csv", stringsAsFactors = FALSE)
link_map <- list(
github = list(icon = "images/GitHub-Mark-32px.png", width = 15, alt = "GitHub"),
orcid = list(icon = "images/orcid.png", width = 15, alt = "ORCID"),
linkedin = list(icon = "images/lin.png", width = 15, alt = "LinkedIn"),
twitter = list(icon = "images/Twitter_logo_blue.png", width = 15, alt = "Twitter"),
home = list(icon = "images/Home_icon_black.png", width = 15, alt = "Home"),
scholar = list(icon = "images/scholar.png", width = 30, alt = "Scholar"),
txt = list(icon = "images/txt.png", width = 15, alt = "CV"),
bluesky = list(icon = "images/Bluesky_Logo.png", width = 15, alt = "Bluesky")
)
build_links <- function(links_str) {
if (is.na(links_str) || links_str == "") return("")
parts <- unlist(strsplit(links_str, ";"))
links <- vapply(parts, function(part) {
bits <- unlist(strsplit(part, "\\|"))
if (length(bits) != 2) return("")
type <- bits[1]
url <- bits[2]
info <- link_map[[type]]
if (is.null(info)) return("")
sprintf("<a href=\"%s\"><img src=\"%s\" style=\"width: %spx;\" alt=\"%s\"/></a>",
url, info$icon, info$width, info$alt)
}, "")
paste(links, collapse = " ")
}
cat("<div class=\"people-list\">\n")
for (i in seq_len(nrow(people))) {
row <- people[i, ]
links_html <- build_links(row$links)
name_line <- sprintf("<span class=\"person-name\">%s</span>", row$name)
if (!is.na(row$pronouns) && row$pronouns != "") {
name_line <- paste0(name_line, sprintf(" <span>(%s)</span>", row$pronouns))
}
if (links_html != "") {
name_line <- paste0(name_line, sprintf(" <span class=\"person-links\">%s</span>", links_html))
}
cat("<div class=\"person-card\">\n")
cat(sprintf("<img class=\"person-photo\" src=\"%s\" alt=\"%s\" loading=\"lazy\" decoding=\"async\"/>\n",
row$image, row$name))
cat("<div class=\"person-meta\">\n")
cat(sprintf("<p>%s</p>\n", name_line))
cat(sprintf("<p>%s</p>\n", row$bio))
cat("</div>\n")
cat("</div>\n")
}
cat("</div>\n")
```
## Lab Alumni
```{r people_alumni, results='asis', echo=FALSE}
format_list <- function(df) {
for (i in seq_len(nrow(df))) {
name <- df$name[i]
url <- df$url[i]
role <- df$role[i]
label <- if (!is.na(url) && nzchar(url)) {
sprintf("<a href=\"%s\">%s</a>", url, name)
} else {
name
}
if (!is.na(role) && nzchar(role)) {
cat(sprintf("- %s %s\n", label, role))
} else {
cat(sprintf("- %s\n", label))
}
}
}
alumni <- read.csv("data/people_alumni.csv", stringsAsFactors = FALSE)
format_list(alumni)
```
### Visiting Scholar: for >100 hours of scholastic visitation
```{r people_visiting, results='asis', echo=FALSE}
visiting <- read.csv("data/people_visiting.csv", stringsAsFactors = FALSE)
format_list(visiting)
```
### Fellow of the R-I Lab: for >500 hours of scholastic fellowship
```{r people_fellow, results='asis', echo=FALSE}
fellow <- read.csv("data/people_fellow.csv", stringsAsFactors = FALSE)
format_list(fellow)
```
### Current Collaborators
```{r people_collab, results='asis', echo=FALSE}
collab <- read.csv("data/people_collaborators.csv", stringsAsFactors = FALSE)
for (group in unique(collab$group)) {
cat(sprintf("**%s**\n\n", group))
subset <- collab[collab$group == group, ]
for (i in seq_len(nrow(subset))) {
name <- subset$name[i]
url <- subset$url[i]
note <- subset$note[i]
label <- if (!is.na(url) && nzchar(url)) {
sprintf("<a href=\"%s\">%s</a>", url, name)
} else {
name
}
if (!is.na(note) && nzchar(note)) {
cat(sprintf("- %s %s\n", label, note))
} else {
cat(sprintf("- %s\n", label))
}
}
cat("\n")
}
```