check_urls Check urls in dynamic report files (.md, .Rmd & .qmd)
Details
The function can be used to check if url addresses in dynamic reports are broken. Taken from Nan Xiao's blogpost (https://nanx.me/blog/post/rmarkdown-quarto-link-checker/).
References
Araya-Salas, M., & Arriaga Madrigal, A. Y. sketchy: Create Custom Research Compendiums. R package (run citation("sketchy") for the current version).
Xiao, N. (2023). A General-Purpose Link Checker for R Markdown and Quarto Projects. Blog post. https://nanx.me/blog/post/rmarkdown-quarto-link-checker/
Author
Nan Xiao (me@nanx.me)
Examples
# \donttest{
data(compendiums)
# make compendiums
make_compendium(name = "my_compendium", path = tempdir(),
format = "basic", force = TRUE)
#> Setting project on an existing directory ...
#> README.Rmd already exists.
#> my_compendium
#> ├─data/
#> │ ├─processed/ # modified/rearranged data
#> │ └─raw/ # original data
#> ├─manuscript/ # manuscript/poster figures
#> ├─output/ # all non-data products of data analysis
#> └─scripts/ # code
#> Done.
#>
# check urls in scripts
check_urls(path = file.path(tempdir(), "my_compendium", "scripts"))
#> ℹ Package NA
#> ℹ Checking that VignetteBuilder package knitr is installed.
#> ✔ VignetteBuilder package knitr is installed.
#> ✔ All URLs are correct!
# }