LibraryCarpentry / lc-r

Introduction to R
http://librarycarpentry.org/lc-r/
Other
14 stars 28 forks source link

_episode_rmd changes are not rendered into the website #43

Closed libjohn closed 3 years ago

libjohn commented 3 years ago

Here's a newbie question for the team.

On Nov 11 2020 through Dec 1 2020, I made some changes to the _episodes_rmd folder. I am just now noticing that while those changes are reflected in the github repository. They are not reflected in the on the lesson's rendered website (e.g https://librarycarpentry.org/lc-r/03-data-cleaning-and-transformation/)

I have no experience with Jekyl and don't know how this site gets built. I assumed (incorrectly?), that since we are using R Markdown, and there is an _epsiodes_rmd directory, that I should make changes in the _episodes_rmd directory. But there is a also an _episodes directory.

Since my changes are not reflected in the rendered HTML, I guess I don't understand the procedure. Can someone demystify this for me? I'm not sure why both directories are there. Maybe I should copy the changed files from _episodes_rmd into _episodes?


Thanks for contributing! If this contribution is for instructor training, please send an email to checkout@carpentries.org with a link to this contribution so we can record your progress. You’ve completed your contribution step for instructor checkout just by submitting this contribution.

If this issue is about a specific episode within a lesson, please provide its link or filename.

Please keep in mind that lesson maintainers are volunteers and it may be some time before they can respond to your contribution. Although not all contributions can be incorporated into the lesson materials, we appreciate your time and effort to improve the curriculum. If you have any questions about the lesson maintenance process or would like to volunteer your time as a contribution reviewer, please contact The Carpentries Team at team@carpentries.org.


fmichonneau commented 3 years ago

we now have a GitHub Actions that will take care of rendering and deploying the site automatically. You only make changes to the _episodes_rmd folder and after each push/merged pull requests, the Rmd files get interpreted into markdown files, and generate the website.

On the maintainers' end, the change is that they will need to work from the main branch instead of gh-pages, as the gh-pages should only be updated by the scripts that run on GitHub Actions. If it's something you'd be interested in doing, please let me know, I'd be happy to set this up for you.

libjohn commented 3 years ago

Thanks for the information. @fmichonneau, it's fine with me if you set this up for me. At the moment I can only see the gh-pages branch.

fmichonneau commented 3 years ago

I created the new branch main and made it the default. Once the pull request #44 is merged, the build and deployment will be automated.

libjohn commented 3 years ago

Sounds good. Since it's Friday afternoon, I'll pick this back up next week. many thanks.

libjohn commented 3 years ago

@fmichonneau -- I still do not seeing the repository changes from the main branch reflected in the rendered web site. I merged your PR earlier today. When you get a chance can you help troubleshoot?

A quick check is to look at https://librarycarpentry.org/lc-r/03-data-cleaning-and-transformation/index.html and notice that the first code block uses the dir.create() function, while the modified repository main branch uses dir_create() -- as seen here in line 60

Can you help?

fmichonneau commented 3 years ago

Hi @libjohn ,

I just pushed https://github.com/LibraryCarpentry/lc-r/commit/835506285eaa5e7028db6b74444b17f46aa0a803 which should address the issue. It turns out that if rm(list = ls()) is evaluated when rendering the lessons, it wipes out important functions and variables we need for rendering the site and breaks subsequent steps. Not evaluating this should address the issue and the changes should be visible

libjohn commented 3 years ago

awesome. Thanks @fmichonneau

We may want to move towards a more reproducible solution than rm(lists = ls()) There's a good thread about that here, but the gist is to recommend the "restart R, run all" technique. I'll start a separate discussion about that. Many thanks!