tidynomicon
tidynomicon copied to clipboard
Publishing Rmd to GitHub Pages
The section on publishing a report to GitHub pages discusses different options for rendering an R Markdown and ensuring it ends up in the correct folder / branch to be hosted.
Specifically it proposes these options:
Put up with it.
Write a small function that changes the current wording directory to docs, knits ../report.Rmd, then changes the working directory back to the project root.
Use something like Make to build everything on the command line and then move all the generated files into docs.
Two points here:
- Its now be possible to specify the output directory using
rmarkdown::render()
e.g. `rmarkdown::render("my_file.Rmd", output_dir = "docs") - Should we mention GitHub Actions as another rendering option? On one hand, this can handle some of this automatically; however, it would require a good deal more explanation (CI, installing dependencies, etc.)