knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(workbch)
One function of the workbch package is to make navigation a little easier: job_open()
allows you to switch between jobs, and job_openurl()
opens a URL linked to the job in a browser window. The screencast below illustrates this:
A second function of workbch is to keep track of the git status of various projects. A common workflow problem (for me, at least) is that I sometimes forget to commit changes or push them upstream, and then forget which projects I've left in this "unclean" state. The job_gitreport()
function aims to make this easier by checking the git status for all jobs, and reporting those jobs that are not in a clean state. For example:
job_gitreport()
# A tibble: 3 x 6 jobname staged unstaged untracked ahead behind <chr> <int> <int> <int> <int> <int> 1 conjunction 0 1 1 3 0 2 psychtheory 0 0 1 0 0 3 tidylsrbook 0 24 12 0 0
Screencast illustrating how job_gitreport()
works:
A third function of the workbch package is keeping track of job locations when they move around on the local machine, as long as they stay somewhere on the workbch search path (i.e., the "workbch.search" option). It does this by matching information stored in the ".workbch" sentinel file to entries in the "workbch_jobs.json" file. There are two functions that are useful for this:
job_list()
throws a warning if a job folder has movedjob_seek()
will ask if you want to update the location This is illustrated in the screencast below:
A common task is to update the information associated with a job. The priority may change, it may be assigned a new owner or acquire a new URL, etc. The job_modify()
function can be used for this, as illustrated below:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.