knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(dovetail)

This package is designed to be compatible with existing workflows, meaning that one should be able to mix the current syntax with new syntax seamlessly:

Example 1: nested block quote

## With New Formatting ```{challenge, coo = TRUE} #' ## Challenge 2 #' #' Given the following code: #' #' ```r x <- c(5.4, 6.2, 7.1, 4.8, 7.5) names(x) <- c('a', 'b', 'c', 'd', 'e') print(x) #' ``` #' #' Write a subsetting command to return the values in x that are greater than 4 and less than 7. #' #' @solution Solution to challenge 2 #' #' ```r x_subset <- x[x<7 & x>4] print(x_subset) #' ``` wzxhzdk:2 ```{callout, eval = FALSE} #' The code in this callout chunk will not be evaluated, but the text will #' still appear! #' ```r stop("hammertime") #' ``` wzxhzdk:3 The sentence "`r x`" has **`r n`** words. ## Jekyll options The Carpentries lessons currently run on Jekyll, so we have provided hooks to modify the output to work with jekyll, which can be loaded with the `dvt_opts()` function: wzxhzdk:4 wzxhzdk:5 wzxhzdk:6 The code for this is migrated from the styles repository: wzxhzdk:7 # Preparing an existing lesson for using {dovetail}: To update the lessons, the special blockquotes will be converted to code chunks and the setup chunk will do the following replacement: wzxhzdk:8 To prepare an existing lesson with RMarkdown, install {dovetail} and {pegboard} with wzxhzdk:9 > **A note on {pegboard}**: This package will read in and transform your > existing lessons to the dovetail format, but there may be rendering mistakes, > so please inspect the result with git diff and rendering the site locally There are two steps to updating the lessons: 1. open your lesson in RStudio 2. run `source(system.file("convert", "convert.R", package = "dovetail"))` The conversion script looks like this: wzxhzdk:10

carpentries/dovetail documentation built on Sept. 23, 2021, 9:35 p.m.