Scenario: I am running a workshop in which I share the link to a project that the students open in their own RStudio Cloud account. This is a workshop on creating R packages.
on my project (the one I am sharing with the link above), then the students are unable to open the project. They get an error that says cannot open docs folder presumably because it was trying to open my home/docs which the students cannot access. I could not figure out any way to fix this problem except by running
pkgdown::build_site()
which then created a docs folder in the project. Then the students could open the project as docs was in the project. I didn't want docs in the project, but if I deleted the folder, the students would get the docs folder does not exist error again.
Any way to stop this from happening or at least is there a way for me to control what directory the project tries to open when the students open my link (above)?
The contents of a home directory (for example ~/docs) are not copied when a student creates a derived project. If you want students to be able to access those files, you will need to place the site files under the /cloud/project directory.
And then I am no longer able to share the project with my students. I can't get it out of the 'setting' where the project link tries to open "~/docs" when they open it.
Same problem occurs if I run pkgdown::build_site() and then delete the docs folder that is created.
For some reason after running pkgdown::build_site(), the project link wants to open the folder where the site was created.
I ran a quick test to see if I could reproduce the problem, but I wasn't able to. Would you be willing to share the project with me so I can take a look? You can send a DM with a link if its in a personal workspace, otherwise you can add me by email.
I don't think it should do anything. It just created a pkgdown site at that location. I didn't do anything to say 'open this project in ~/docs' not do I see that when I open the project.
Then I do this
Open Safari or Chrome browser (those are the only ones I tried)
Clear cookies and history
Try to open Posit Cloud. As a student so different Google account not my instructor account.
Get this error
Error navigating to cloud/project/docs
No such directory Note there is in fact no such directory in the project
Click 'Ok'
It puts me at ~ (home directory) and no way to get to the temporary project.
Reload Posit Cloud. and all works fine and temporary project opens as I expect.
Clear the cache and history.
Get the error about no cloud/project/docs directory again.
Reload. It's ok.
Another weirdness is that I didn't create the pkgdown site at cloud/project/docs but at ~/docs. There is no docs folder in the project folder. But the fact that pkgdown::build_site() is affecting the directory where the temporary project wants to open is very odd.