OVERVIEW
I have found that the trackdown package is incredibly useful for collaboration with non-R users. It's design suggests that the main use case was a group of researchers all working on one paper -- a big .Rmd file. The package documentation has a very clear workflow description.
I've put some wrappers and additional code around the package to make working with a couple dozen Distill pages.
This set of functions is handy for synchronizing more than a dozen .Rmd files by simplifying the following:
- Detecting local files that have never been uploaded by trackdown to the Google Drive directory
- Detecting local files that have been modified and need to be updated (overwritten in the corresponding Google Doc)
- Detecting edits of Google Docs by others that need to be downloaded to the corresponding .Rmd file
WORKFLOW FOR DISTILL
- Synchronize Google and local files (resolve conflicts, etc.)
- Rebuild the site
- Commit and push to GitHub
- Check on Netilfy or wherever
NOTE
The date and authorship comparisons don't detect MY updates in the Google Doc versions, so I've resorted to using a different Google ID for edits on the Google side.
EXAMPLE
In the following example, the compare_drive function has returned R code that can be copy-pasted into the R session. The functions perform the following:
- update - local .Rmd files that have been edited and need to be updated in Google Docs
- upload - new files that are found locally and need to be uploaded to Google Docs (none found in this example)
- download - Google Docs that have been edited, so have text that needs to be merged with the local .Rmd file
> all_files <- compare_drive()
update these ".Rmd" files:
update('registration-activity.Rmd', force = TRUE)
update('definitions-and-terms.Rmd', force = TRUE)
update('index.Rmd', force = TRUE)
upload these ".Rmd" files:
DOWNLOAD these ".Rmd" files:
download('membership.Rmd', force = TRUE)
>
John David Smith https://twitter.com/smithjd and https://learningalliances.net