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

Feature request: ask to install tutorial dependencies #253

Closed
isteves opened this issue Jul 8, 2019 · 3 comments
Closed

Feature request: ask to install tutorial dependencies #253

isteves opened this issue Jul 8, 2019 · 3 comments
Labels
difficulty: intermediate Enterprising community members could help effort: low < 1 day of work help wanted Solution is well-specified enough that any community member could fix priority: medium Could be fixed before next release

Comments

@isteves
Copy link
Contributor

isteves commented Jul 8, 2019

Hi! @jules32, @angela-li, and I are working on improving the use_tutorial() function for usethis, which sets up the learnr tutorial package format . Our two main use cases are (1) package developers that want to include tutorials as documentation and (2) course instructors that want to distribute a bundle of tutorials to students.

For course instructors, it's especially important to minimize friction related to package installs. Thus, it would be great if run_tutorial() would prompt the user to install packages that the tutorial depends on.

@cderv recommended 3 options to find the dependencies in the tutorial:

utils::menu() could then be used to ask users if it's okay to install all the dependencies.

@schloerke
Copy link
Collaborator

This is a great idea!

Do you think packrat::appDependencies would work for this use case?

A difficulty that we have run into for learnr documents is that authors are writing broken code for students to fix. While great for teaching, this is hard to parse. rstudio/packrat#551 fixed this by parsing per chunk vs the whole file. learnr's next release will already have packrat as a suggested dependency to help with this deployment problem, so no new dependency will be needed.

I am open to a PR. Maybe install_tutorial_dependencies(file)?

Please do not include graphics for utils::menu.


Thank you for the help with usethis::use_tutorial()!

@schloerke schloerke added difficulty: intermediate Enterprising community members could help effort: low < 1 day of work help wanted Solution is well-specified enough that any community member could fix priority: medium Could be fixed before next release labels Jul 8, 2019
@isteves
Copy link
Contributor Author

isteves commented Jul 11, 2019

It looks like packrat:::fileDependencies() will work for this. I hadn't thought of broken code, but it definitely seems like a common use-case in teaching!

I'll see what I can put together 👍

Noted. 😄 Gabor also mentioned that it can be problematic

@cderv
Copy link
Collaborator

cderv commented Jul 30, 2019

This should now be closed by #267.
Thanks for the idea @isteves!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: intermediate Enterprising community members could help effort: low < 1 day of work help wanted Solution is well-specified enough that any community member could fix priority: medium Could be fixed before next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants