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

Helper for constructing links suitable for use_course() #406

Closed
jennybc opened this issue Jul 3, 2018 · 6 comments · Fixed by #821
Closed

Helper for constructing links suitable for use_course() #406

jennybc opened this issue Jul 3, 2018 · 6 comments · Fixed by #821
Labels
course 👩‍🏫 feature tidy-dev-day 🤓

Comments

@jennybc
Copy link
Member

@jennybc jennybc commented Jul 3, 2018

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.

@maelle
Copy link
Contributor

@maelle maelle commented Jul 4, 2018

Maybe relevant, https://github.com/ottlngr/tinycc

@jennybc
Copy link
Member Author

@jennybc jennybc commented Jul 4, 2018

Relevant to RStudio folks, note that Rebrandly has an API:
https://developers.rebrandly.com/docs

@hadley hadley added feature course 👩‍🏫 labels Nov 24, 2018
@jennybc
Copy link
Member Author

@jennybc jennybc commented Jan 14, 2019

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.

@jennybc jennybc added the tidy-dev-day 🤓 label Jan 14, 2019
@cwickham
Copy link
Contributor

@cwickham cwickham commented Jan 19, 2019

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.

@cwickham
Copy link
Contributor

@cwickham cwickham commented Jan 19, 2019

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.

@cwickham
Copy link
Contributor

@cwickham cwickham commented Jan 19, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
course 👩‍🏫 feature tidy-dev-day 🤓
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants