Closed jennybc closed 4 years ago
Maybe relevant, https://github.com/ottlngr/tinycc
Relevant to RStudio folks, note that Rebrandly has an API: https://developers.rebrandly.com/docs
Example: consider this GitHub repo
https://github.com/jennybc/explore-libraries
The correct use_course()
call is
use_course("https://github.com/jennybc/explore-libraries/archive/master.zip")
It would be nicer to say `use_course("jennybc/explore-libraries"). This reduces the need to create short links.
I'm going to work on this for tidy-dev-day, but if someone else at dev-day wants to help, I'd love to work together.
OK, to not bite off too much at once, I'll focus on the github repo use case, use_course("jennybc/explore-libraries")
. Essentially turning the recommendations about URLs for Github (and Dropbox?) in ?use_course_details
into things that happen automatically.
API questions for @jennybc , how should this work from a user's perspective:
Somehow automatically identify that a user is specifying a user/repo
form of link: use_course("jennybc/explore-libraries")
? But how to distinguish this from a shortlink minus the http
, e.g. use_course("bit.ly/explore-libraries")
?
Make the user identify this is a github link via an argument (which might have a useful default?), use_course("jennybc/explore-libraries", github = TRUE)
, or use_course("jennybc/explore-libraries", host = "github")
? But this defeats the purpose of less typing.
A different function name, use_github_course("jennybc/explore-libraries")
?
Either way, we need to keep mind how to generalise to other common sources, i.e. Dropbox.
Answers based on in-person discussion:
use_course()
should identify a github style shortlink and expand to the required URL: use_course("https://github.com/jennybc/explore-libraries/archive/master.zip")
Distinguish between github and shortlinks via a shortlink whitelist bit.ly
, rtsd.io
Look into repo spec to help.
Provide more help (and a convenient place of docs) re: how to get "download" links for GitHub, DropBox, Google Drive.
If possible, also a way to make short links from usethis.