knitr::opts_chunk$set(echo = TRUE, eval = FALSE)
if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("Bioconductor/workshopbuilder")
.options <- workshopbuilder:::.options
workshopbuilder
ships with a number of package options to make management
of workshop directories and repositories easier. The three main options are:
1) Workshop book repository location on GitHub
.options$set("BOOK_REPO", "Bioconductor/BiocWorkshops2019")
2) Local workshop book directory
.options$set("LOCAL_REPO", normalizePath("~/BiocWorkshops2019"))
3) Local workshop repositories directory
.options$set("REPOS_PATH", normalizePath("~/Bioconductor/Workshops"))
The workshopbuilder
package facilitates the installation and rendering
of the workshop book repository along with all the component repositories.
The individual workshop repositories are documented as GitHub issues in the main workshop book repository.
We then take the workshops and the main book repository and clone them all. We install and transfer vignettes to the main book repository and run a render step to generate the book document.
workshopbuilder
takes issues with a [Workshop]
tag and pulls workshops
from the URL provided in the body of the issue.
pull
if already available)The package uses git2r
to clone all invididual workshop repositories
(or those otherwise indicated) to the location as specified by the REPOS_PATH
package option (see setup).
library(workshopbuilder)
shopstatus <- installWorkshops("MultiAssayWorkshop", exclude = FALSE, ncpus = 12)
R CMD INSTALL *
on each repositoryThe output of the installation can be seen by using getStatus
:
getStatus()
The text of the installation output can be posted as a comment in the
issue by running postStatus
.
Note. This requires a GITHUB_PAT
Personal Authentication Token (PAT)
environment variable (usually in .Renviron
).
postStatus()
data.frame
with metadata for each workshop repositoryThis data.frame
includes metadata including the issue number and
URL location
shopstatus
Installation output is saved to a file in the REPOS_PATH
folder; defaults
to "buildout".
list.files( file.path(.options$get("REPOS_PATH"), "buildout") )
This can be done by running the getBookRepo
function. It will take the
BOOK_REPO
package value and clone from GitHub.
getBookRepo()
Using the desc
package, we then add all the successfully installed workshops
to the DESCRIPTION
file of the book repository.
Notice that shopstatus
has a logical column that indicates a successful
installation called 'install'.
addWorkshops(shopstatus)
We then transfer all successful workshop Rmd files to the main book repository for building.
rmds <- transferVignettes(shopstatus)
Rmd
files in the configuration file for book buildingWe make sure to document the added R Markdown files in the _bookdown.yml
configuration file.
addRmdFiles(rmds)
The configuration files that are pre-included in the workshop book repository
allow the book to build. In the future, we may consider adding this step
via the R interface. We use these files to render the book into the different
formats depending on the input to the renderWorkshops
format.
renderWorkshops(format = "all")
repo)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.