-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrender_cv.R
More file actions
25 lines (20 loc) · 1.04 KB
/
Copy pathrender_cv.R
File metadata and controls
25 lines (20 loc) · 1.04 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
#!/usr/bin/env Rscript
# This script builds both the HTML and PDF versions of your CV
# If you wanted to speed up rendering for googlesheets driven CVs you could use
# this script to cache a version of the CV_Printer class with data already
# loaded and load the cached version in the .Rmd instead of re-fetching it twice
# for the HTML and PDF rendering. This exercise is left to the reader.
# Knit the HTML version
if (!require("pacman")) install.packages("pacman", repos='http://cran.us.r-project.org')
pacman::p_load("rmarkdown", "pagedown")
rmarkdown::render("Combs_CV.Rmd",
params = list(pdf_mode = FALSE),
output_file = "index.html")
# Knit the PDF version to temporary html location
tmp_html_cv_loc <- fs::file_temp(ext = ".html")
rmarkdown::render("Combs_CV.Rmd",
params = list(pdf_mode = TRUE),
output_file = tmp_html_cv_loc)
# Convert to PDF using Pagedown
pagedown::chrome_print(input = tmp_html_cv_loc,
output = "Ian_R_Combs_curriculum_vitae.pdf")