Skip to content

Commit 5ef955c

Browse files
Fix README previews
1 parent 8dc2170 commit 5ef955c

File tree

2 files changed

+16
-20
lines changed

2 files changed

+16
-20
lines changed

README.Rmd

+10-8
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,22 @@ Examples of using this package can be found in the list below and in the slides
7171

7272
There are currently `r length(template_name)` templates available in this package:
7373

74-
```{r show-previews, echo = FALSE, results='asis'}
74+
```{r show-previews, echo = FALSE, results = "asis"}
7575
preview_url <- sprintf("https://pkg.mitchelloharawild.com/vitae/reference/%s.html", template_name)
7676
preview_title <- sprintf("[**vitae::%s**](%s)", template_name, preview_url)
7777
preview_image <- sprintf("[![Preview of %s](%s){width=415px}](%s)", template_name, template_preview, preview_url)
7878
7979
preview_row <- (seq_along(preview_title)+1)%/%2
80-
for(i in split(seq_along(preview_title), preview_row)) {
81-
print(
82-
knitr::kable(
83-
tibble::new_tibble(setNames(as.list(preview_image[i]), preview_title[i]), nrow = 1),
84-
escape = FALSE
85-
)
80+
tables <- lapply(split(seq_along(preview_title), preview_row), function(i){
81+
colsize <- nchar(preview_image[i])
82+
c(
83+
paste0("| ", paste0(stringr::str_pad(preview_title[i], colsize, "right"), collapse = " | "), " |"),
84+
paste0("|", paste0(stringr::str_dup("-", colsize+2), collapse = "|"), "|"),
85+
paste0("| ", paste0(preview_image[i], collapse = " | "), " |"),
86+
""
8687
)
87-
}
88+
})
89+
cat(do.call(c, tables), sep = "\n")
8890
```
8991
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).
9092

README.md

+6-12
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,16 @@ slides presented at [ozunconf2018](https://ozunconf18.ropensci.org/):
8181
There are currently 6 templates available in this package:
8282

8383
| [**vitae::awesomecv**](https://pkg.mitchelloharawild.com/vitae/reference/awesomecv.html) | [**vitae::hyndman**](https://pkg.mitchelloharawild.com/vitae/reference/hyndman.html) |
84-
|:-------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------|
85-
| [<img src="man/figures/preview-awesomecv.png" width="415"
86-
alt="Preview of awesomecv" />](https://pkg.mitchelloharawild.com/vitae/reference/awesomecv.html) | [<img src="man/figures/preview-hyndman.png" width="415"
87-
alt="Preview of hyndman" />](https://pkg.mitchelloharawild.com/vitae/reference/hyndman.html) |
84+
|--------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
85+
| [<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) |
8886

8987
| [**vitae::latexcv**](https://pkg.mitchelloharawild.com/vitae/reference/latexcv.html) | [**vitae::markdowncv**](https://pkg.mitchelloharawild.com/vitae/reference/markdowncv.html) |
90-
|:---------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------|
91-
| [<img src="man/figures/preview-latexcv.png" width="415"
92-
alt="Preview of latexcv" />](https://pkg.mitchelloharawild.com/vitae/reference/latexcv.html) | [<img src="man/figures/preview-markdowncv.png" width="415"
93-
alt="Preview of markdowncv" />](https://pkg.mitchelloharawild.com/vitae/reference/markdowncv.html) |
88+
|----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
89+
| [<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) |
9490

9591
| [**vitae::moderncv**](https://pkg.mitchelloharawild.com/vitae/reference/moderncv.html) | [**vitae::twentyseconds**](https://pkg.mitchelloharawild.com/vitae/reference/twentyseconds.html) |
96-
|:-----------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------|
97-
| [<img src="man/figures/preview-moderncv.png" width="415"
98-
alt="Preview of moderncv" />](https://pkg.mitchelloharawild.com/vitae/reference/moderncv.html) | [<img src="man/figures/preview-twentyseconds.png" width="415"
99-
alt="Preview of twentyseconds" />](https://pkg.mitchelloharawild.com/vitae/reference/twentyseconds.html) |
92+
|------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|
93+
| [<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) |
10094

10195
Extending the package to add new templates is a somewhat simple process
10296
(details in the [creating vitae

0 commit comments

Comments
 (0)