forked from GuangchuangYu/cv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.Rmd
More file actions
327 lines (224 loc) · 7.1 KB
/
index.Rmd
File metadata and controls
327 lines (224 loc) · 7.1 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
---
title: "Yumin Huang's CV"
author: "Yumin Huang"
date: "`r Sys.Date()`"
output:
pagedown::html_resume:
css: styles.css
self_contained: yes
---
```{r, include=FALSE}
knitr::opts_chunk$set(
results='asis',
echo = FALSE
)
CRANpkg <- function (pkg) {
cran <- "https://CRAN.R-project.org/package"
fmt <- "[%s](%s=%s)"
sprintf(fmt, pkg, cran, pkg)
}
Biocpkg <- function (pkg) {
sprintf("[%s](http://bioconductor.org/packages/%s)", pkg, pkg)
}
library(glue)
library(tidyverse)
# Set this to true to have links turned into footnotes at the end of the document
PDF_EXPORT <- F
# Holds all the links that were inserted for placement at the end
links <- c()
find_link <- regex("
\\[ # Grab opening square bracket
.+? # Find smallest internal text as possible
\\] # Closing square bracket
\\( # Opening parenthesis
.+? # Link text, again as small as possible
\\) # Closing parenthesis
",
comments = TRUE)
sanitize_links <- function(text){
if(FALSE){
str_extract_all(text, find_link) %>%
pluck(1) %>%
walk(function(link_from_text){
title <- link_from_text %>% str_extract('\\[.+\\]') %>% str_remove_all('\\[|\\]')
link <- link_from_text %>% str_extract('\\(.+\\)') %>% str_remove_all('\\(|\\)')
# add link to links array
links <<- c(links, link)
# Build replacement text
new_text <- glue('{title}<sup>{length(links)}</sup>')
# Replace text
text <<- text %>% str_replace(fixed(link_from_text), new_text)
})
}
text
}
# Takes a single row of dataframe corresponding to a position
# turns it into markdown, and prints the result to console.
build_position_from_df <- function(pos_df){
missing_start <- pos_df$start == 'N/A'
dates_same <- pos_df$end == pos_df$start
if (pos_df$end == 9999) {
pos_df$end = "present"
}
if(any(c(missing_start,dates_same))){
timeline <- pos_df$end
} else {
timeline <- glue('{pos_df$end} - {pos_df$start}')
}
descriptions <- pos_df[str_detect(names(pos_df), 'description')] %>%
as.list() %>%
map_chr(sanitize_links)
# Make sure we only keep filled in descriptions
description_bullets <- paste('-', descriptions[descriptions != 'N/A'], collapse = '\n')
if (length(description_bullets) == 1 && description_bullets == "- ") {
description_bullets <- ""
}
glue(
"### {sanitize_links(pos_df$title)}
{pos_df$loc}
{pos_df$institution}
{timeline}
{description_bullets}
"
) %>% print()
}
# Takes nested position data and a given section id
# and prints all the positions in that section to console
print_section <- function(position_data, section_id){
x <- position_data %>%
filter(section == section_id) %>%
pull(data)
prese <- " - "
xx <- list()
for (i in seq_along(x)) {
y = x[[i]]
y <- cbind(y, start2 = as.character(y$start))
y <- cbind(y, end2 = as.character(y$end))
se <- paste(y$start, "-", y$end, collapse = " ")
if (prese == se) {
y$start2 = ""
y$end2 = ""
} else {
prese = se
}
xx[[i]] <- select(y, -c(start, end)) %>%
rename(start=start2, end=end2)
}
xx %>%
purrr::walk(build_position_from_df)
}
fill_nas <- function(column){
ifelse(is.na(column), 'N/A', column)
}
# Load csv with position info
position_data <- read_csv('positions.csv') %>%
mutate_all(fill_nas) %>%
arrange(order, desc(end)) %>%
mutate(id = 1:n()) %>%
nest(data = c(-id, -section))
```
```{r}
# When in export mode the little dots are unaligned, so fix that.
if(PDF_EXPORT){
cat("
<style>
:root{
--decorator-outer-offset-left: -6.5px;
}
</style>")
}
```
Aside
================================================================================
{width=100%}
```{r}
# When in export mode the little dots are unaligned, so fix that.
if(PDF_EXPORT){
cat("View this CV online with links at _sdws1983.github.io/cv_")
}
```
Contact 联系方式{#contact}
--------------------------------------------------------------------------------
- <i class="fa fa-envelope"></i> ymhuang[AT]fafu.edu.cn
- <i class="fa fa-github"></i> https://github.com/sdws1983
- <i class="fa fa-link"></i> https://sdws1983.github.io/
- <i class="fa fa-phone"></i> (86) 15652920371
<br>
```{r message=FALSE, warning=FALSE}
#if(TRUE){}else{
profile = jsonlite::fromJSON("profile.json")
cites = jsonlite::fromJSON("citation.json")
if (profile$total_cites < sum(cites$cites))
profile$total_cites <- sum(cites$cites)
glue(
"
+ Citation = {profile$total_cites}
+ H-index = {profile$h_index}
+ I10-index = {profile$i10_index}
"
) %>% print()
#}
```

Disclaimer {#disclaimer}
--------------------------------------------------------------------------------
Last updated on `r Sys.Date()`.
Main
================================================================================
黄育敏 Yumin Huang {#title}
--------------------------------------------------------------------------------
```{r, results='asis'}
intro_text <- glue("PhD of Crop genetics and breeding")
cat(sanitize_links(intro_text))
cat("\n")
cat("\n")
intro_text <- glue("Lecturer")
cat(sanitize_links(intro_text))
cat("\n")
cat("\n")
intro_text <- glue("[Center for Genomics](http://genome.fafu.edu.cn/), [Haixia Institute of Science and Technology](https://net.fafu.edu.cn/hist/main.htm)")
cat(sanitize_links(intro_text))
cat("\n")
cat("\n")
intro_text <- glue("[Fujian Agriculture and Forestry University](https://www.fafu.edu.cn/)")
cat(sanitize_links(intro_text))
cat("\n")
cat("\n")
```
Our research primarily centers on model crops of the tribe Andropogoneae, including sugarcane and maize, and integrates comparative genomics, population genetics, and epigenomics. Driven by innovations in analytical methodologies, we aim to elucidate principles of crop genome evolution, identify and exploit favorable allelic variation, and dissect the regulatory mechanisms governing transcription.
Education & Research {data-icon=desktop data-concise=true}
--------------------------------------------------------------------------------
```{r, results='asis', echo = FALSE}
print_section(position_data, 'education')
```
Scholarships & Awards {data-icon=trophy}
--------------------------------------------------------------------------------
```{r}
print_section(position_data, 'award')
```
Publications {data-icon=book}
--------------------------------------------------------------------------------
```{r}
print_section(position_data, 'academic_articles')
```
Grants {data-icon=chart-line}
--------------------------------------------------------------------------------
```{r}
print_section(position_data, 'grant')
```
Conference attendance {data-icon=group}
--------------------------------------------------------------------------------
```{r}
print_section(position_data, 'presentation')
```
```{r}
if(FALSE){
cat("
Links {data-icon=link}
--------------------------------------------------------------------------------
")
walk2(links, 1:length(links), function(link, index){
print(glue('{index}. {link}'))
})
}
```