|
| 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 | +} |
0 commit comments