append_links: Append links to cv printer attributes

Description Usage Arguments Examples

View source: R/append_links.R

Description

Helper function to append links to a ‘cv_printer' object’s 'links' attribute.

Usage

1
append_links(cv, new_links)

Arguments

cv

object of class 'cv_printer' created by new_cv_printer

new_links

Character array of new links to append to links attribute.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
text_w_links <- "Here is my text with a cool [markdown link](https://my_cool_website.com/a_page) in it. For good measure [here's another link.](http://another_cool_site.com/)"

# Setup empty CV printer
printer <- new_cv_printer(list(), pdf_mode = TRUE)

extract_results <- extract_links(text_w_links, printer)

# Text w/ no links is here
extract_results$text

# Extracted links are here
extract_results$links

# No links stored yet
attr(printer, 'links')

# We can then append these links to our CV so it remembers them for later footnote printing
printer <- printer %>% append_links(extract_results$links)

# Links have been updated
attr(printer, 'links')

nstrayer/cvdown documentation built on Feb. 18, 2020, 12:35 a.m.