Cannot share project after running pkgdown

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.

Here is the demo project that students were using

If I run

pkgdown::build_site(override = list(destination = "~/docs"))

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)?

Hi there,

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.

Hope that helps,
-Andy

Hi,

No I don't want them to access those files. The problem is that if I run this code

pkgdown::build_site(override = list(destination = "~/docs"))

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.

Thanks,

Eli

Hi there,

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.

Thanks
-Andy

The error is very odd. Here is more info.

Here is a link to a project. It is not in a workspace. I share this link with students.

In this one project I ran this code before I shared with students.

pkgdown::build_site(override = list(destination = "~/docs"))

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

  1. Open Safari or Chrome browser (those are the only ones I tried)
  2. Clear cookies and history
  3. Try to open Posit Cloud. As a student so different Google account not my instructor account.
  4. Get this error
    Error navigating to cloud/project/docs
    No such directory
    Note there is in fact no such directory in the project
  5. Click 'Ok'
  6. It puts me at ~ (home directory) and no way to get to the temporary project.
  7. Reload Posit Cloud. and all works fine and temporary project opens as I expect.
  8. Clear the cache and history.
  9. Get the error about no cloud/project/docs directory again.
  10. 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.

Thanks for any help!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.