-
Notifications
You must be signed in to change notification settings - Fork 301
Description
It would be great if usethis could provide a helper function that creates a README badge for existing RStudio Cloud projects.
The proposed use_rscloud_badge() function would create a README badge that could link to either public or private RStudio Cloud projects, since the only parameter required would be the link to the existing RStudio Cloud project. Such a README badge would be immediately useful to those who teach classes or share research compendia with RStudio Cloud. Another value added is that this function could standardize what RStudio Cloud README badges look like across GitHub.
I created a draft badge URL for your consideration using shields.io, shown below. It uses the color shown here and the RStudio logo which was already accessible on shields.io from the list of "Simple Icon slugs" here:
Badge:
URL: https://img.shields.io/badge/launch-cloud-75AADB?style=flat&logo=rstudio
The use case is not easy to show in a reprex since it requires knitting an .Rmd, so instead I've created a test GitHub repository here and used it to spin up a public RStudio Cloud project here. The functionality that I'm proposing for use_rscloud_badge("https://rstudio.cloud/project/3584129") would be equivalent to calling:
use_badge("Launch RStudio Cloud", "https://rstudio.cloud/project/3584129", "https://img.shields.io/badge/launch-cloud-75AADB?style=flat&logo=rstudio")The implementation of use_rscloud_badge() would be along these lines in badge.R:
#' @rdname badges
#' @param cloudurl A link to an existing RStudio Cloud project
#' @export
use_rscloud_badge <- function(cloudurl) {
img <- "https://img.shields.io/badge/launch-cloud-75AADB?style=flat&logo=rstudio"
use_badge("Launch RStudio Cloud", cloudurl, img)
invisible(TRUE)
}