Skip to content

Commit 8da80b3

Browse files
committed
update #4
1 parent 785e3fe commit 8da80b3

21 files changed

+693
-381
lines changed

β€ŽR/bg_df.R

+7-10
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@ library(googlesheets4)
66

77
link <- "https://docs.google.com/spreadsheets/d/1UXBQs_tu0cRYN3XDEPsq3MxlUNvryPEnR-ClSp2uipo/edit?usp=sharing"
88

9-
con <- googlesheets4::read_sheet(link,
10-
sheet = "conferences") %>% mutate(activity = "conferences")
11-
edu <- googlesheets4::read_sheet(link,
12-
sheet = "edu") %>% mutate(activity = "education")
13-
int <- googlesheets4::read_sheet(link,
14-
sheet = "internships") %>% mutate(activity = "research stays")
15-
emp <- googlesheets4::read_sheet(link,
16-
sheet = "work") %>% mutate(activity = "employment")
17-
team <- googlesheets4::read_sheet(link,
18-
sheet = "team")
9+
bio_df <- googlesheets4::read_sheet(link, sheet = "basic_info")
10+
con <- googlesheets4::read_sheet(link, sheet = "conferences") %>% mutate(activity = "conferences")
11+
edu <- googlesheets4::read_sheet(link, sheet = "edu") %>% mutate(activity = "education")
12+
int <- googlesheets4::read_sheet(link, sheet = "internships") %>% mutate(activity = "research stays")
13+
emp <- googlesheets4::read_sheet(link, sheet = "work") %>% mutate(activity = "employment")
14+
team <- googlesheets4::read_sheet(link, sheet = "team")
15+
other_act_df <- googlesheets4::read_sheet(link, sheet = "other_activities")
1916

2017
full_df <- full_join(con, edu, by = c("start_date", "end_date", "city", "country", "name", "who", "activity")) %>%
2118
full_join(., int, by = c("start_date", "end_date", "city", "country", "name", "who", "activity")) %>%

β€ŽR/create_ppl_page.R

+171
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# whois_full_name <- "MichaΕ‚"
2+
# whois <- whois
3+
# whois <- "Jarek"
4+
5+
source('R/bg_df.R')
6+
source('R/resume_fun.R')
7+
8+
create_ppl_page <- function(whois_full_name, whois, file_name){
9+
10+
qmd_header <- paste0(
11+
"---
12+
title: '", whois_full_name, "'\n",
13+
"sidebar: false
14+
format:
15+
html:
16+
grid:
17+
sidebar-width: 0px
18+
body-width: 1500px
19+
margin-width: 300px
20+
gutter-width: 1.5rem
21+
knitr:
22+
opts_chunk:
23+
out.width: '95%'
24+
---
25+
26+
```{r, echo=FALSE, message=FALSE,include=FALSE}
27+
source('../../R/bg_df.R')
28+
whois <- '", whois, "'\n\n",
29+
"source('../../R/resume_fun.R')
30+
openalex_id <- basic_info(whois)$openalex_id
31+
library(fontawesome)
32+
```
33+
\n\n")
34+
35+
36+
bio_txt <- if_else(basic_info(whois)$bio %>% is.na(), paste0("<!-- # πŸ“ **Bio** -->
37+
38+
<!-- ------------------------------------------------------------------------ -->
39+
40+
<!-- `r stringr::str_flatten(basic_info(whois)$bio)` -->", "\n")
41+
, "# πŸ“ **Bio**
42+
43+
------------------------------------------------------------------------
44+
45+
`r stringr::str_flatten(basic_info(whois)$bio)`
46+
\n")
47+
48+
49+
contact_txt <- if_else((bio_df %>% filter(who == whois) %>% .[3:8] %>% janitor::remove_empty() %>% ncol()) != 0,
50+
paste0(
51+
"# πŸ“± **Contact**
52+
53+
------------------------------------------------------------------------
54+
55+
", stringr::str_flatten(contact_info(whois)$new_col), "\n"),
56+
paste0("<!-- # πŸ“± **Contact** -->
57+
58+
<!-- ------------------------------------------------------------------------ -->
59+
60+
<!-- stringr::str_flatten(contact_info(whois)$new_col) -->", "\n")
61+
)
62+
63+
64+
research_txt <- if_else((full_df %>% filter(who == whois & cat == "research stays") %>% nrow()) != 0, paste0(
65+
"# πŸš€ **Research stays**
66+
67+
------------------------------------------------------------------------
68+
69+
```{r, echo=FALSE, message=FALSE}
70+
research_stay(whois)
71+
```", "\n"), paste0(
72+
"<!-- # πŸš€ **Research stays** -->
73+
74+
<!-- ------------------------------------------------------------------------ -->
75+
76+
<!-- ```{r, echo=FALSE, message=FALSE} -->
77+
<!-- research_stay(whois) -->
78+
<!-- ``` -->", "\n"))
79+
80+
81+
employment_txt <- if_else((full_df %>% filter(who == whois & cat == "employment") %>% nrow()) != 0, paste0(
82+
"# πŸ’»πŸ§« **Experience**
83+
84+
------------------------------------------------------------------------
85+
86+
```{r, echo=FALSE, message=FALSE}
87+
work(whois)
88+
```
89+
\n"), paste0(
90+
"<!-- # πŸ’»πŸ§« **Experience** -->
91+
92+
<!-- ------------------------------------------------------------------------ -->
93+
94+
<!-- ```{r, echo=FALSE, message=FALSE} -->
95+
<!-- work(whois) -->
96+
<!-- ``` -->", "\n"
97+
))
98+
99+
100+
101+
education_txt <- if_else((full_df %>% filter(who == whois & cat == "education") %>% nrow()) != 0, paste0(
102+
"# πŸŽ“ **Education**
103+
104+
------------------------------------------------------------------------
105+
106+
`r stringr::str_flatten(education(whois)$new_col)`
107+
\n"),
108+
paste0(
109+
"<!-- # πŸŽ“ **Education** -->
110+
111+
<!-- ------------------------------------------------------------------------ -->
112+
113+
<!-- `r stringr::str_flatten(education(whois)$new_col)` -->", "\n"
114+
))
115+
116+
117+
conference_txt <- if_else((full_df %>% filter(who == whois & cat == "conferences") %>% nrow()) != 0, paste0(
118+
"# πŸ‘πŸ» **Conferences, workshops** 🀝🏻
119+
120+
------------------------------------------------------------------------
121+
122+
```{r, echo=FALSE, message=FALSE}
123+
conf_work(whois)
124+
```
125+
\n"),
126+
paste0(
127+
"<!-- # πŸ‘πŸ» **Conferences, workshops** 🀝🏻 -->
128+
129+
<!-- ------------------------------------------------------------------------ -->
130+
131+
<!-- ```{r, echo=FALSE, message=FALSE} -->
132+
<!-- conf_work(whois) -->
133+
<!-- ``` -->", "\n"))
134+
135+
136+
publication_txt <- if_else((openalexR::oa_fetch(entity ="works", author.id = basic_info(whois)$openalex_id) %>% nrow()) != 0, paste0(
137+
"# πŸ“– **Publications**
138+
139+
------------------------------------------------------------------------
140+
141+
```{r, echo=FALSE, message=FALSE}
142+
pubs(whois, openalex_id)
143+
```
144+
\n"),
145+
paste0(
146+
"<!-- # πŸ“– **Publications** -->
147+
148+
<!-- ------------------------------------------------------------------------ -->
149+
150+
<!-- ```{r, echo=FALSE, message=FALSE} -->
151+
<!-- pubs(whois, openalex_id) -->
152+
<!-- ``` -->", "\n"))
153+
154+
155+
other_act_txt <- if_else((other_act(whois) %>% filter(who == whois) %>% nrow()) != 0, paste0(
156+
"# πŸ§‘πŸ»β€πŸ”¬ **Other activities**
157+
158+
------------------------------------------------------------------------
159+
160+
`r stringr::str_flatten(other_act(whois)$new_col)`
161+
\n"),
162+
paste0("<!-- # πŸ§‘πŸ»β€πŸ”¬ **Other activities** -->
163+
164+
<!-- ------------------------------------------------------------------------ -->
165+
166+
<!-- `r stringr::str_flatten(other_act(whois)$new_col)` -->", "\n"))
167+
168+
169+
write_lines(c(qmd_header, bio_txt, contact_txt, research_txt, employment_txt, education_txt, conference_txt, publication_txt, other_act_txt),
170+
file = paste0(file_name, ".qmd"))
171+
}

β€ŽR/resume_fun.R

+24
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,27 @@ pubs <- function(whois, openalex_id){
7272
}
7373

7474

75+
other_act <- function(whois){
76+
temp_df <- other_act_df %>%
77+
filter(who == whois) %>%
78+
mutate(new_col = paste0("* ", activity, "\n"
79+
))
80+
}
81+
82+
basic_info <- function(whois){
83+
temp_df <- bio_df %>%
84+
filter(who == whois)
85+
}
86+
87+
contact_info <- function(whois){
88+
basic_info(whois) %>%
89+
mutate(new_col = paste0(
90+
if_else(email1 %>% is.na(), "", paste0("[`r fontawesome::fa('envelope', prefer_type = 'regular', fill = 'pink', height = '3em')`](mailto:", email1, ")\n")),
91+
if_else(email2 %>% is.na(), "", paste0("[`r fontawesome::fa('envelope', prefer_type = 'regular', fill = 'grey', height = '3em')`](mailto:", email2, ")\n")),
92+
if_else(github %>% is.na(), "", paste0("[`r fontawesome::fa('github', fill = '#24292e', height = '3em')`](https://github.com/", github, ")\n")),
93+
if_else(orcid %>% is.na(), "", paste0("[`r fontawesome::fa('orcid', fill = '#A6CE39', height = '3em')`](https://orcid.org/", orcid, ")\n")),
94+
if_else(fb %>% is.na(), "", paste0("[`r fontawesome::fa('facebook', fill = '#304f85', height = '3em')`](https://www.facebook.com/", fb, ")\n")),
95+
if_else(linkedin %>% is.na(), "", paste0("[`r fontawesome::fa('linkedin', fill = '#0077b5', height = '3em')`](https://www.linkedin.com/in/", linkedin, "/)\n")),
96+
if_else(X %>% is.na(), "", paste0("[`r fontawesome::fa('x-twitter', fill = '#24292e', height = '3em')`](https://x.com/", X, ")\n"))
97+
))
98+
}

β€Žsubsite/team/_temp.qmd renamed to β€Žsubsite/_temp.qmd

+8
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,11 @@ conf_work(whois)
105105

106106
------------------------------------------------------------------------
107107

108+
```{r, echo=FALSE, message=FALSE}
109+
110+
act_df <- other_act(whois)
111+
112+
```
113+
114+
`r stringr::str_flatten(act_df$new_col)`
115+

β€Žsubsite/colab.qmd

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ title: "BioGenies collaborators"
44

55
### ![](fig/logo/UAB_logo.png){width="10%"} Autonomous University of Barcelona
66
::: {layout-ncol=5}
7-
[![Eva Arribas](fig/ppl/ea.png "Eva Arribas"){}]()
7+
[![Eva Arribas](fig/ppl/ea.png "Eva Arribas"){}](colab/ear.html)
88

9-
[![Oriol BΓ‘rcenas](fig/ppl/ob.png "Oriol BΓ‘rcenas"){}]()
9+
[![Oriol BΓ‘rcenas](fig/ppl/ob.png "Oriol BΓ‘rcenas"){}](colab/ob.html)
1010

11-
[![Carlos Pintado-Grima](fig/ppl/cp.png "Carlos Pintado-Grima"){}]()
11+
[![Carlos Pintado-Grima](fig/ppl/cp.png "Carlos Pintado-Grima"){}](colab/cpg.html)
1212
:::
1313

1414
### ![](fig/logo/QI_logo.png){width="10%"} Quadram Institute

β€Žsubsite/colab/cpg.qmd

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
title: 'Carlos Pintado-Grima'
3+
sidebar: false
4+
format:
5+
html:
6+
grid:
7+
sidebar-width: 0px
8+
body-width: 1500px
9+
margin-width: 300px
10+
gutter-width: 1.5rem
11+
knitr:
12+
opts_chunk:
13+
out.width: '95%'
14+
---
15+
16+
```{r, echo=FALSE, message=FALSE,include=FALSE}
17+
source('../../R/bg_df.R')
18+
whois <- 'Carlos'
19+
20+
source('../../R/resume_fun.R')
21+
openalex_id <- basic_info(whois)$openalex_id
22+
library(fontawesome)
23+
```
24+
25+
26+
27+
<!-- # πŸ“ **Bio** -->
28+
29+
<!-- ------------------------------------------------------------------------ -->
30+
31+
<!-- `r stringr::str_flatten(basic_info(whois)$bio)` -->
32+
33+
# πŸ“± **Contact**
34+
35+
------------------------------------------------------------------------
36+
37+
[`r fontawesome::fa('envelope', prefer_type = 'regular', fill = 'pink', height = '3em')`](mailto:[email protected])
38+
[`r fontawesome::fa('orcid', fill = '#A6CE39', height = '3em')`](https://orcid.org/0000-0002-8544-959X)
39+
40+
41+
<!-- # πŸš€ **Research stays** -->
42+
43+
<!-- ------------------------------------------------------------------------ -->
44+
45+
<!-- ```{r, echo=FALSE, message=FALSE} -->
46+
<!-- research_stay(whois) -->
47+
<!-- ``` -->
48+
49+
<!-- # πŸ’»πŸ§« **Experience** -->
50+
51+
<!-- ------------------------------------------------------------------------ -->
52+
53+
<!-- ```{r, echo=FALSE, message=FALSE} -->
54+
<!-- work(whois) -->
55+
<!-- ``` -->
56+
57+
<!-- # πŸŽ“ **Education** -->
58+
59+
<!-- ------------------------------------------------------------------------ -->
60+
61+
<!-- `r stringr::str_flatten(education(whois)$new_col)` -->
62+
63+
<!-- # πŸ‘πŸ» **Conferences, workshops** 🀝🏻 -->
64+
65+
<!-- ------------------------------------------------------------------------ -->
66+
67+
<!-- ```{r, echo=FALSE, message=FALSE} -->
68+
<!-- conf_work(whois) -->
69+
<!-- ``` -->
70+
71+
# πŸ“– **Publications**
72+
73+
------------------------------------------------------------------------
74+
75+
```{r, echo=FALSE, message=FALSE}
76+
pubs(whois, openalex_id)
77+
```
78+
79+
80+
<!-- # πŸ§‘πŸ»β€πŸ”¬ **Other activities** -->
81+
82+
<!-- ------------------------------------------------------------------------ -->
83+
84+
<!-- `r stringr::str_flatten(other_act(whois)$new_col)` -->
85+

0 commit comments

Comments
Β (0)