Skip to content

Commit

Permalink
Fix README preview image generation
Browse files Browse the repository at this point in the history
Resolves #253
  • Loading branch information
mitchelloharawild committed May 3, 2024
1 parent cf0d68a commit 274fa85
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 33 deletions.
38 changes: 17 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# vitae <img src="man/figures/logo.png" align="right" />

Expand All @@ -8,12 +7,12 @@
<!-- badges: start -->

[![CRAN
status](https://www.r-pkg.org/badges/version/vitae)](https://cran.r-project.org/package=vitae)
status](https://www.r-pkg.org/badges/version/vitae.png)](https://cran.r-project.org/package=vitae)
[![R check
status](https://github.com/mitchelloharawild/vitae/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/mitchelloharawild/vitae/actions/workflows/R-CMD-check.yaml)
[![Lifecycle:
maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html#maturing)
[![Downloads](https://cranlogs.r-pkg.org/badges/vitae)](https://cran.r-project.org/package=vitae)
[![Downloads](https://cranlogs.r-pkg.org/badges/vitae.png)](https://cran.r-project.org/package=vitae)
<!-- badges: end -->

## Templates and tools for making a Résumé/CV
Expand Down Expand Up @@ -57,10 +56,13 @@ If you prefer a guided introduction in video form, check out [Bryan
Jenks](https://github.com/tallguyjenks)
[freeCodeCamp](https://github.com/freeCodeCamp/freeCodeCamp) [tech
talk](https://youtu.be/cMlRAiQUdD8):

[![](man/figures/freecodecamp.jpg)](https://youtu.be/cMlRAiQUdD8)

Creating a new CV with `vitae` can be done using the RStudio R Markdown
template selector: ![](man/figures/template_gui.png)
template selector:

![](man/figures/template_gui.png)

These templates leverage the strength of rmarkdown to include common
information in the YAML header (name, position, social links…) and
Expand All @@ -76,23 +78,17 @@ programmatically into your CV.

There are currently 6 templates available in this package:

| [**vitae::awesomecv**](https://pkg.mitchelloharawild.com/vitae/reference/awesomecv.html) | [**vitae::hyndman**](https://pkg.mitchelloharawild.com/vitae/reference/hyndman.html) |
|--------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| [<img src="man/figures/preview-awesomecv.png" width="415"
alt="Preview of awesomecv" />](https://pkg.mitchelloharawild.com/vitae/reference/awesomecv.html) | [<img src="man/figures/preview-hyndman.png" width="415"
alt="Preview of hyndman" />](https://pkg.mitchelloharawild.com/vitae/reference/hyndman.html) |

| [**vitae::latexcv**](https://pkg.mitchelloharawild.com/vitae/reference/latexcv.html) | [**vitae::markdowncv**](https://pkg.mitchelloharawild.com/vitae/reference/markdowncv.html) |
|----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| [<img src="man/figures/preview-latexcv.png" width="415"
alt="Preview of latexcv" />](https://pkg.mitchelloharawild.com/vitae/reference/latexcv.html) | [<img src="man/figures/preview-markdowncv.png" width="415"
alt="Preview of markdowncv" />](https://pkg.mitchelloharawild.com/vitae/reference/markdowncv.html) |

| [**vitae::moderncv**](https://pkg.mitchelloharawild.com/vitae/reference/moderncv.html) | [**vitae::twentyseconds**](https://pkg.mitchelloharawild.com/vitae/reference/twentyseconds.html) |
|------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|
| [<img src="man/figures/preview-moderncv.png" width="415"
alt="Preview of moderncv" />](https://pkg.mitchelloharawild.com/vitae/reference/moderncv.html) | [<img src="man/figures/preview-twentyseconds.png" width="415"
alt="Preview of twentyseconds" />](https://pkg.mitchelloharawild.com/vitae/reference/twentyseconds.html) |
| [**vitae::awesomecv**](https://pkg.mitchelloharawild.com/vitae/reference/awesomecv.html) | [**vitae::hyndman**](https://pkg.mitchelloharawild.com/vitae/reference/hyndman.html) |
|-------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| [<img src="man/figures/preview-awesomecv.png" width="415" alt="awesomecv" />](https://pkg.mitchelloharawild.com/vitae/reference/awesomecv.html) | [<img src="man/figures/preview-hyndman.png" width="415" alt="hyndman" />](https://pkg.mitchelloharawild.com/vitae/reference/hyndman.html) |

| [**vitae::latexcv**](https://pkg.mitchelloharawild.com/vitae/reference/latexcv.html) | [**vitae::markdowncv**](https://pkg.mitchelloharawild.com/vitae/reference/markdowncv.html) |
|-------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| [<img src="man/figures/preview-latexcv.png" width="415" alt="latexcv" />](https://pkg.mitchelloharawild.com/vitae/reference/latexcv.html) | [<img src="man/figures/preview-markdowncv.png" width="415" alt="markdowncv" />](https://pkg.mitchelloharawild.com/vitae/reference/markdowncv.html) |

| [**vitae::moderncv**](https://pkg.mitchelloharawild.com/vitae/reference/moderncv.html) | [**vitae::twentyseconds**](https://pkg.mitchelloharawild.com/vitae/reference/twentyseconds.html) |
|----------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [<img src="man/figures/preview-moderncv.png" width="415" alt="moderncv" />](https://pkg.mitchelloharawild.com/vitae/reference/moderncv.html) | [<img src="man/figures/preview-twentyseconds.png" width="415" alt="twentyseconds" />](https://pkg.mitchelloharawild.com/vitae/reference/twentyseconds.html) |

Extending the package to add new templates is a somewhat simple process
(details in the [creating vitae
Expand Down
17 changes: 5 additions & 12 deletions README.Rmd → README.qmd
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
---
output: github_document
format: gfm
---

<!-- README.md is generated from README.Rmd. Please edit that file -->

```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

# vitae <img src="man/figures/logo.png" align="right" />
*/ˈviːteɪ/*

Expand Down Expand Up @@ -58,9 +49,11 @@ tinytex::install_tinytex()
The *vitae* package currently supports `r length(list.dirs("inst/rmarkdown/templates/", recursive = FALSE))` popular CV templates. You can see some previews of the available templates [below](#templates).

If you prefer a guided introduction in video form, check out [Bryan Jenks](https://github.com/tallguyjenks)' [freeCodeCamp](https://github.com/freeCodeCamp/freeCodeCamp) [tech talk](https://youtu.be/cMlRAiQUdD8):

[![](man/figures/freecodecamp.jpg)](https://youtu.be/cMlRAiQUdD8)

Creating a new CV with `vitae` can be done using the RStudio R Markdown template selector:

![](man/figures/template_gui.png)

These templates leverage the strength of rmarkdown to include common information in the YAML header (name, position, social links...) and extended information in the main body. The main body of the CV is written using markdown, and allows for data-driven generation of entries using the [`*_entries` functions](https://pkg.mitchelloharawild.com/vitae/reference/cv_entries.html). This allows you to import your working history from other sources (such as ORCID, Google Scholar, or a maintained dataset), and include them programmatically into your CV.
Expand All @@ -72,7 +65,7 @@ There are currently `r length(template_name)` templates available in this packag
```{r show-previews, echo = FALSE, results = "asis"}
preview_url <- sprintf("https://pkg.mitchelloharawild.com/vitae/reference/%s.html", template_name)
preview_title <- sprintf("[**vitae::%s**](%s)", template_name, preview_url)
preview_image <- sprintf("[![Preview of %s](%s){width=415px}](%s)", template_name, template_preview, preview_url)
preview_image <- sprintf("[<img src=\"%s\" width=\"415\" alt=\"%s\" />](%s)", template_preview, template_name, preview_url)
preview_row <- (seq_along(preview_title)+1)%/%2
tables <- lapply(split(seq_along(preview_title), preview_row), function(i){
Expand All @@ -84,7 +77,7 @@ tables <- lapply(split(seq_along(preview_title), preview_row), function(i){
""
)
})
cat(do.call(c, tables), sep = "\n")
cat(c("```{=markdown}", unlist(tables), "```"), sep = "\n")
```
Extending the package to add new templates is a somewhat simple process (details in the [creating vitae templates](https://pkg.mitchelloharawild.com/vitae/articles/extending.html) vignette).

Expand Down

0 comments on commit 274fa85

Please sign in to comment.