Skip to content
Permalink
Browse files
control package linking
  • Loading branch information
JohnMount committed Sep 6, 2020
1 parent dd4abb9 commit a7cadfc8810bc9dfff565a2cb4cf362fe662a3d9
Showing 1 changed file with 10 additions and 4 deletions.
@@ -282,11 +282,17 @@ href_package_ref <- function(package) {
if (!is.null(reference_url)) {
reference_url
} else {
# Fall back to rdrr.io
if (is_base_package(package)) {
paste0("https://rdrr.io/r/", package)
package_href_function <- getOption("downlit.package_href_function", default = NULL)
if(is.null(package_href_function)) {
# Fall back to rdrr.io
if (is_base_package(package)) {
paste0("https://rdrr.io/r/", package)
} else {
paste0("https://rdrr.io/pkg/", package, "/man")
}
} else {
paste0("https://rdrr.io/pkg/", package, "/man")
# Example: options(c("downlit.package_href_function" = function(package) { paste0("#", package) }))
package_href_function(package)
}
}
}

0 comments on commit a7cadfc

Please sign in to comment.