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 toFALSE
, 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.
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, rmd = FALSE)
#> → Creating Lesson in /tmp/RtmpUWqX2P/file18801fc7159b...
#> ℹ No schedule set, using Rmd files in episodes/ directory.
#> → Creating Lesson in /tmp/RtmpUWqX2P/file18801fc7159b...
#> → To remove this message, define your schedule in config.yaml or use `set_episodes()` to generate it.
#> → Creating Lesson in /tmp/RtmpUWqX2P/file18801fc7159b...
#> ────────────────────────────────────────────────────────────────────────
#> → Creating Lesson in /tmp/RtmpUWqX2P/file18801fc7159b...
#> ℹ To save this configuration, use
#>
#> set_episodes(path = path, order = ep, write = TRUE)
#> → Creating Lesson in /tmp/RtmpUWqX2P/file18801fc7159b...
#> ✔ First episode created in /tmp/RtmpUWqX2P/file18801fc7159b/episodes/introduction.md
#> → Creating Lesson in /tmp/RtmpUWqX2P/file18801fc7159b...
#> ℹ Workflows up-to-date!
#> → Creating Lesson in /tmp/RtmpUWqX2P/file18801fc7159b...
#> ✔ Lesson successfully created in /tmp/RtmpUWqX2P/file18801fc7159b
#> → Creating Lesson in /tmp/RtmpUWqX2P/file18801fc7159b...
#> /tmp/RtmpUWqX2P/file18801fc7159b
create_episode("first-script", path = tmp)
check_lesson(tmp)
build_lesson(tmp)