R/read-books.R

#' Browse packaging guidelines
#'
#' A convenience function to automatically open the web page of rOpenSci's
#' "Package Development Guide" in the default browser.
#'
#' @param which Whether to read the released or "dev" development version.
#' @return Nothing. Function called purely for side-effect of opening web page
#' with package guidelines.
#'
#' @export
#' @examples
#' \dontrun{
#' read_pkg_guide ()
#' }
read_pkg_guide <- function (which = c ("release", "dev")) {
    which <- match.arg (which [1],
        c ("release", "dev"),
        several.ok = FALSE
    )

    utils::browseURL (sprintf ("%sbuilding.html", devguide_url (which)))
}


devguide_url <- function (which) {
    switch (which,
        release = "https://devguide.ropensci.org/",
        dev = "https://devdevguide.netlify.app/"
    )
}
ropensci-review-tools/pkgcheck documentation built on Nov. 24, 2024, 7:57 p.m.