Skip to contents

This function orchestrates rendering generated lesson content and applying the theme for the HTML site.

Usage

build_lesson(
  path = ".",
  rebuild = FALSE,
  quiet = !interactive(),
  preview = TRUE,
  override = list()
)

Arguments

path

the path to your repository (defaults to your current working directory)

rebuild

if TRUE, everything will be built from scratch as if there was no cache. Defaults to FALSE, which will only build markdown files that haven't been built before.

quiet

when TRUE, output is supressed

preview

if TRUE, the rendered website is opened in a new window

override

options to override (e.g. building to alternative paths). This is used internally and will likely be changed.

Value

TRUE if it was successful, a character vector of issues if it was unsuccessful.

Details

Structure of a Workbench Lesson

A Carpentries Workbench lesson is comprised of a set of markdown files and folders:

+-- config.yaml
+-- index.md
+-- episodes
|   +-- data
|   +-- fig
|   +-- files
|   \-- introduction.Rmd
+-- instructors
|   \-- instructor-notes.md
+-- learners
|   \-- setup.md
+-- profiles
|   \-- learner-profiles.md
+-- links.md
+-- site
    \-- [...]
+-- renv
|   \-- [...]
+-- CODE_OF_CONDUCT.md
+-- CONTRIBUTING.md
+-- LICENSE.md
\-- README.md

See also

serve(): an interactive way to build and edit lesson content.

Examples


tmp <- tempfile()
create_lesson(tmp, open = FALSE)
#> → Creating Lesson in /tmp/RtmpsPBux1/file1a882347c4a0...
#>  No schedule set, using Rmd files in episodes/ directory.
#> → Creating Lesson in /tmp/RtmpsPBux1/file1a882347c4a0...

#> To remove this message, define your schedule in config.yaml or use `set_episodes()` to generate it.
#> → Creating Lesson in /tmp/RtmpsPBux1/file1a882347c4a0...

#> ────────────────────────────────────────────────────────────────────────
#> → Creating Lesson in /tmp/RtmpsPBux1/file1a882347c4a0...

#>  To save this configuration, use
#> 
#> set_episodes(path = path, order = ep, write = TRUE)
#> → Creating Lesson in /tmp/RtmpsPBux1/file1a882347c4a0...

#>  First episode created in /tmp/RtmpsPBux1/file1a882347c4a0/episodes/introduction.Rmd
#> → Creating Lesson in /tmp/RtmpsPBux1/file1a882347c4a0...

#>  Workflows up-to-date!
#> → Creating Lesson in /tmp/RtmpsPBux1/file1a882347c4a0...

#>  Lesson successfully created in /tmp/RtmpsPBux1/file1a882347c4a0
#> → Creating Lesson in /tmp/RtmpsPBux1/file1a882347c4a0...

#> /tmp/RtmpsPBux1/file1a882347c4a0
create_episode("first-script", path = tmp)
check_lesson(tmp)
build_lesson(tmp)