Pre-Commit Hook for Processing README.Rmd

When writing an R package I usually create a README.Rmd
file that I render to README.md
. I use {pkgdown}
to then create documentation. I run the last step via CI, so once it’s set up I never need to think about it again.
The problem is that I regularly forget to process the README.Rmd
file, which means that despite keeping that up to date, everything else lags behind.
What if I automated the process? I created a simple pre-commit hook which processes README.Rmd
whenever I make a commit and automatically adds any changes to the commit.