Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function use_rscloud_badge() #1584

Closed
gvelasq opened this issue Feb 13, 2022 · 7 comments · Fixed by #1589
Closed

Add function use_rscloud_badge() #1584

gvelasq opened this issue Feb 13, 2022 · 7 comments · Fixed by #1589

Comments

@gvelasq
Copy link
Contributor

gvelasq commented Feb 13, 2022

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: launch cloud
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)
}
@malcolmbarrett
Copy link
Collaborator

I wonder if this is a better fit for rscloud? That package already imports usethis, too, so it would be easy to add

@gvelasq
Copy link
Contributor Author

gvelasq commented Feb 14, 2022

Thank you for considering. A positive for users could be that use_rscloud_badge() might provide a more visible alternative to use_binder_badge() in usethis, but I understand it would introduce additional maintenance burden. That said, I would be happy with either solution and could submit a PR to whichever package would be a better fit.

Adding @mine-cetinkaya-rundel for an opinion on whether rscloud would be a better fit for use_rscloud_badge().

@mine-cetinkaya-rundel
Copy link
Contributor

I don't think this belongs in the rscloud package because currently that package only interacts with the RStudio Cloud API. Adding this functionality there would require bringing in a new API interface to rscloud and new documentation to help users use this function, which will likely point back to the usethis documentation anyway.

@gvelasq
Copy link
Contributor Author

gvelasq commented Feb 16, 2022

Thanks very much for your opinion, @mine-cetinkaya-rundel. @malcolmbarrett, please advise if it would be OK to submit a PR for use_rscloud_badge() in usethis.

@malcolmbarrett
Copy link
Collaborator

Thanks @mine-cetinkaya-rundel. @gvelasq I don't know if it will get merged, but I think it's a nice badge and, as you say, there's some precedence with the binder badge (I'd also probably use the RS Cloud badge), so I'd say give it a shot

@gvelasq
Copy link
Contributor Author

gvelasq commented Feb 21, 2022

I've been reading through the trademark and logo usage guidelines, and while I believe that an RStudio Cloud README badge might be permissible, I've written to permissions@rstudio.com to confirm before submitting a pull request.

@hadley
Copy link
Member

hadley commented Feb 23, 2022

I think a PR would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants