sandpaper
sandpaper copied to clipboard
[Future] transition to use 'chapter' over 'episode'
Eventually we will want to convert the term "episode" to "chapter." This transition should not be sudden or unexpected, so this is very much a future plan.
These all the places that contain the word 'episode':
R/validators.R:29:check_episode_name <- function(path) {
R/validators.R:32:assertthat::on_failure(check_episode_name) <- function(call, env) {
R/utils-varnish.R:67: instructor_sidebar <- create_sidebar(c(idx, these_resources[["episodes"]]))
R/utils-sidebar.R:58:#' Varnish uses a sidebar for navigation across and within an episode. This
R/utils-sidebar.R:59:#' funciton will create a sidebar item for a single episode, providing a
R/utils-sidebar.R:60:#' dropdown menu of the sections within the episode if it is labeled as the
R/utils-sidebar.R:61:#' current episode.
R/utils-sidebar.R:108:#' Varnish uses a sidebar for navigation across and within an episode. Each
R/utils-sidebar.R:109:#' episode's sidebar is different because there needs to be a clear indicator
R/utils-sidebar.R:110:#' which episode is the current one within the sidebar.
R/utils-renv.R:151:#' if (interactive() && fs::dir_exists("episodes")) {
R/utils-paths-source.R:8:path_episodes <- function(inpath) {
R/utils-paths-source.R:10: fs::path(home, "episodes")
R/utils-paths-source.R:35:#' specifying the folder name in the lesson (e.g. "episodes").
R/utils-paths-source.R:36:#' @param warn if `TRUE` and `subfolder = "episodes"`, a message is issued to
R/utils-paths-source.R:37:#' the user if the episodes field of the configuration file is empty.
R/utils-paths-source.R:47: should_warn <- warn && is.null(cfg[["episodes"]])
R/utils-paths-source.R:58: # 3. Warn if the episode order has not been set.
R/utils-paths-source.R:60: is_episodes <- subfolder == "episodes"
R/utils-paths-source.R:61: old_version <- is_episodes && "schedule" %in% names(cfg)
R/utils-paths-source.R:64: names(cfg)[names(cfg) == "schedule"] <- "episodes"
R/utils-paths-source.R:74: should_warn <- should_warn && is_episodes
R/utils-paths-source.R:117: subfolder <- c("episodes", "learners", "instructors", "profiles")
R/utils-paths-source.R:128:get_sources <- function(path, subfolder = "episodes") {
R/utils-paths-source.R:133:get_artifacts <- function(path, subfolder = "episodes") {
R/utils-paths.R:2: rprojroot::find_root(rprojroot::has_dir("episodes"), path)
R/utils-cli.R:32: msg <- "No schedule set, using Rmd files in {.file episodes/} directory."
R/utils-cli.R:34: msg3 <- "or use {.code set_episodes()} to generate it."
R/utils-cli.R:41:show_changed_yaml <- function(sched, order, yaml, what = "episodes") {
R/utils-callr.R:1:callr_build_episode_md <- function(path, hash, workenv, outpath, workdir, root, quiet) {
R/utils-aggregate.R:54:#' - `$needs_episodes`: a logical indicating if the page should be completly
R/utils-aggregate.R:116: needs_episodes = new)
R/utils-aggregate.R:124: needs_episodes <- TRUE
R/utils-aggregate.R:162:#' `xml_document` objects representing episodes in the lesson
R/utils-aggregate.R:188:#' This function assumes that you have already built all the episodes of your
R/utils-aggregate.R:212: if (agg$needs_episodes) {
R/utils-aggregate.R:238: the_episodes <- .resources$get()[["episodes"]]
R/utils-aggregate.R:239: the_slugs <- get_slug(the_episodes)
R/utils-aggregate.R:242: for (episode in seq(the_episodes)) {
R/utils-aggregate.R:243: ep_learn <- ep_instruct <- the_episodes[episode]
R/utils-aggregate.R:244: ename <- the_slugs[episode]
R/utils-aggregate.R:269:#' Get sections from an episode's HTML page
R/utils-aggregate.R:271:#' @param episode an object of class `xml_document`, a path to a markdown or
R/utils-aggregate.R:272:#' html file of an episode.
R/utils-aggregate.R:277:#' @param instructor if `TRUE`, the instructor version of the episode is read,
R/utils-aggregate.R:278:#' defaults to `FALSE`. This has no effect if the episode is an `xml_document`.
R/utils-aggregate.R:293:#' This function will extract the content from the episode without the templating.
R/utils-aggregate.R:304:#' # for episode pages, this will return everything that's not template
R/utils-aggregate.R:311:get_content <- function(episode, content = "*", label = FALSE, pkg = NULL,
R/utils-aggregate.R:313: if (!inherits(episode, "xml_document")) {
R/utils-aggregate.R:315: path <- fs::path(pkg$dst_path, "instructor", as_html(episode))
R/utils-aggregate.R:318: path <- fs::path(pkg$dst_path, as_html(episode))
R/utils-aggregate.R:320: episode <- xml2::read_html(path)
R/utils-aggregate.R:323: res <- xml2::xml_find_all(episode, glue::glue(XPath))
R/template.R:39:template_episode <- generate_template_function("episode")
R/serve.R:16:#' # open the episode for editing
R/serve.R:17:#' file.edit(fs::path(tmp, "episodes", "01-introduction.Rmd"))
R/set_dropdown.R:8:#' listed in `order` are located: episodes, learners, instructors, profiles.
R/set_dropdown.R:21:#' create_episode("using-R", path = tmp)
R/set_dropdown.R:22:#' print(sched <- get_episodes(tmp))
R/set_dropdown.R:25:#' set_episodes(tmp, order = rev(sched))
R/set_dropdown.R:27:#' set_episodes(tmp, order = rev(sched), write = TRUE)
R/set_dropdown.R:30:#' get_episodes(tmp)
R/set_dropdown.R:44: sched <- if (is.null(sched) && folder == "episodes") yaml[["schedule"]] else sched
R/set_dropdown.R:45: sched_folders <- c("episodes", "learners", "instructors", "profiles")
R/set_dropdown.R:111:set_episodes <- function(path = ".", order = NULL, write = FALSE) {
R/set_dropdown.R:112: set_dropdown(path, order, write, "episodes")
R/sandpaper_site.R:27: # TODO: reduce the time needed to re-render a single episode.
tests/testthat/test-clear_site.R:2:suppressMessages(s <- get_episodes(tmp))
tests/testthat/test-clear_site.R:3:set_episodes(tmp, s, write = TRUE)
tests/testthat/test-clear_site.R:15: # I can save a file in the episodes directory and it will be propogated
tests/testthat/test-clear_site.R:16: saveRDS(expected, file = fs::path(tmp, "episodes", "data", "test.rds"))
tests/testthat/test-build_markdown.R:4:create_episode("second-episode", path = tmp)
tests/testthat/test-build_markdown.R:21: suppressMessages(s <- get_episodes(tmp))
tests/testthat/test-build_markdown.R:22: set_episodes(tmp, s, write = TRUE)
tests/testthat/test-build_markdown.R:24: # The episodes should be the only things in the directory
tests/testthat/test-build_markdown.R:25: e <- fs::dir_ls(fs::path(tmp, "episodes"), recurse = TRUE, type = "file")
tests/testthat/test-build_markdown.R:26: s <- get_episodes(tmp)
tests/testthat/test-build_markdown.R:145: s <- get_episodes(tmp)
tests/testthat/test-build_markdown.R:147: e <- fs::dir_ls(fs::path(tmp, "episodes"), recurse = TRUE, type = "file")
tests/testthat/test-build_markdown.R:196: h2 <- expect_hashed(res, "02-second-episode.Rmd")
tests/testthat/test-build_markdown.R:223: fs::file_touch(fs::path(res, "episodes", "01-introduction.Rmd"))
tests/testthat/test-build_markdown.R:233: e2 <- fs::path(res, "episodes", "02-second-episode.Rmd")
tests/testthat/test-build_markdown.R:236: reset_episodes(res)
tests/testthat/test-build_markdown.R:237: set_episodes(res, "01-introduction.Rmd", write = TRUE)
tests/testthat/test-build_markdown.R:242: # The second episode should not exist
tests/testthat/test-build_markdown.R:244: expect_false(fs::file_exists(fs::path(built_path, "02-second-episode.md")))
tests/testthat/test-build_markdown.R:246: # The figures for the second episode should not exist either
tests/testthat/test-build_markdown.R:247: expect_length(get_figs(res, "02-second-episode"), 0)
tests/testthat/test-create_episode.R:3:test_that("prefixed episodes can be created", {
tests/testthat/test-create_episode.R:8: initial_episode <- fs::dir_ls(fs::path(tmp, "episodes"), glob = "*Rmd") %>%
tests/testthat/test-create_episode.R:12: initial_episode_md5 <- tools::md5sum(initial_episode)
tests/testthat/test-create_episode.R:14: second_episode <- create_episode("first-script", path = tmp) %>%
tests/testthat/test-create_episode.R:17: expect_equal(tools::md5sum(second_episode), initial_episode_md5, ignore_attr = TRUE)
tests/testthat/test-create_episode.R:19: expect_true(check_episode(initial_episode))
tests/testthat/test-create_episode.R:20: expect_true(check_episode(second_episode))
tests/testthat/test-create_episode.R:25:test_that("un-prefixed episodes can be created", {
tests/testthat/test-create_episode.R:26: third_episode <- create_episode("third-script", make_prefix = FALSE, path = tmp) %>%
tests/testthat/test-create_episode.R:29: expect_true(check_episode(third_episode))
tests/testthat/test-get_dropdown.R:3:create_episode("outroduction", path = res)
tests/testthat/test-get_dropdown.R:4:outro <- fs::path(res, "episodes", "02-outroduction.Rmd")
tests/testthat/test-get_dropdown.R:17: expect_snapshot(s <- get_dropdown(res, "episodes"))
tests/testthat/test-get_dropdown.R:21:test_that("episodes can be set with the output of get_episodes()", {
tests/testthat/test-get_dropdown.R:23: suppressMessages(s <- get_episodes(res))
tests/testthat/test-get_dropdown.R:24: set_episodes(res, s, write = TRUE)
tests/testthat/test-get_dropdown.R:25: expect_silent(s <- get_episodes(res))
tests/testthat/test-get_dropdown.R:30:test_that("get_episodes() works with trim = FALSE", {
tests/testthat/test-get_dropdown.R:32: expect_silent(s <- get_episodes(res, trim = FALSE))
tests/testthat/test-get_dropdown.R:38:test_that("get_episodes() works in the right order", {
tests/testthat/test-get_dropdown.R:40: expect_silent(s <- get_episodes(res))
tests/testthat/test-get_dropdown.R:41: set_episodes(res, rev(s), write = TRUE)
tests/testthat/test-get_dropdown.R:42: expect_equal(get_episodes(res), rev(eps))
tests/testthat/test-get_dropdown.R:44: expect_silent(s <- get_episodes(res, trim = FALSE))
tests/testthat/test-get_episode.R:3:suppressMessages(e <- get_episodes(res))
tests/testthat/test-get_episode.R:4:set_episodes(res, e, write = TRUE)
tests/testthat/test-get_episode.R:7:cli::test_that_cli("set_episode() will throw an error if an episode does not exist", {
tests/testthat/test-get_episode.R:11: expect_snapshot(expect_error(set_episodes(res, bad, write = TRUE)))
tests/testthat/test-get_episode.R:13: expect_silent(bad_out <- get_episodes(res))
tests/testthat/test-get_episode.R:15: # The output equals the only episode in there
tests/testthat/test-get_episode.R:20:cli::test_that_cli("get_episode() will throw a message about episode in draft", {
tests/testthat/test-get_episode.R:23: if (!fs::file_exists(fs::path(res, "episodes", "02-new.Rmd"))) {
tests/testthat/test-get_episode.R:24: create_episode("new", add = FALSE, path = res)
tests/testthat/test-get_episode.R:26: expect_snapshot(drafty_out <- get_episodes(res))
tests/testthat/test-get_episode.R:31:cli::test_that_cli("get_episode() will throw a warning if an episode in config does not exist", {
tests/testthat/test-get_episode.R:33: # Create a new episode that does not exist
tests/testthat/test-get_episode.R:35: episode_line <- grep("^episodes", cfg)
tests/testthat/test-get_episode.R:38: cfg[seq(episode_line + 1L)],
tests/testthat/test-get_episode.R:40: cfg[seq(episode_line + 2L, length(cfg))]
tests/testthat/test-get_episode.R:47: expect_snapshot(expect_error(get_episodes(res)))
tests/testthat/test-build_episode.R:5:test_that("build_episode_html() returns nothing for an empty page", {
tests/testthat/test-build_episode.R:10: expect_null(build_episode_html(tmp, quiet = TRUE))
tests/testthat/test-build_episode.R:14:test_that("build_episode functions works independently", {
tests/testthat/test-build_episode.R:24: fun_file <- file.path(tmp, "episodes", "files", "fun.Rmd")
tests/testthat/test-build_episode.R:39: res <- build_episode_md(fun_file, workdir = dirname(fun_file))
tests/testthat/test-build_episode.R:52: build_episode_html(res,
tests/testthat/test-template-funs.R:3: expect_equal(fs::path_file(template_episode()), "episode-template.txt")
tests/testthat/examples/ex.md:26:This [rmd link also](../episodes/01-Introduction.Rmd)
tests/testthat/examples/ex.md:32:![link should be transformed](../episodes/fig/Setup.png){alt='alt text'}
tests/testthat/test-utils-callr.R:21:test_that("callr_build_episode_md() works with normal markdown", {
tests/testthat/test-utils-callr.R:24: res <- callr_build_episode_md(
tests/testthat/test-utils-callr.R:34:test_that("callr_build_episode_md() works with Rmarkdown", {
tests/testthat/test-utils-callr.R:38: callr_build_episode_md(
tests/testthat/test-utils-callr.R:50:test_that("callr_build_episode_md() works with Rmarkdown using renv", {
tests/testthat/test-utils-callr.R:56: callr_build_episode_md(
tests/testthat/test-format_syllabus.R:7: suppressMessages(s <- get_episodes(tmp))
tests/testthat/test-format_syllabus.R:8: set_episodes(tmp, s, write = TRUE)
tests/testthat/test-build_lesson.R:161: create_episode("second-episode", path = tmp)
tests/testthat/test-build_lesson.R:162: suppressMessages(s <- get_episodes(tmp))
tests/testthat/test-build_lesson.R:163: set_episodes(tmp, s, write = TRUE)
tests/testthat/test-build_lesson.R:165: rdr <- sandpaper_site(fs::path(tmp, "episodes", "02-second-episode.Rmd"))
tests/testthat/test-build_lesson.R:173: expect_message("Output created: .*02-second-episode.html")
tests/testthat/test-build_lesson.R:182: idx <- xml2::read_html(fs::path(path_site(tmp), "docs", "02-second-episode.html"))
tests/testthat/test-build_lesson.R:187: expect_match(actual, "02-second-episode.html")
tests/testthat/test-build_lesson.R:193: expect_hashed(tmp, "02-second-episode.Rmd")
tests/testthat/test-build_lesson.R:194: rdr <- sandpaper_site(fs::path(tmp, "episodes", "02-second-episode.Rmd"))
tests/testthat/test-build_lesson.R:202: expect_message("Output created: .*02-second-episode.html")
tests/testthat/test-build_lesson.R:219: h2 <- expect_hashed(tmp, "02-second-episode.Rmd")
tests/testthat/test-build_lesson.R:228: expect_true(fs::file_exists(fs::path(sitepath, "02-second-episode.html")))
tests/testthat/test-build_lesson.R:239: readLines(fs::path(sitepath, "02-second-episode.html"))
tests/testthat/test-build_lesson.R:242: "02-second-episode.html",
tests/testthat/test-build_lesson.R:257: fs::file_touch(fs::path(tmp, "episodes", "01-introduction.Rmd"))
tests/testthat/test-build_lesson.R:267: expect_true(fs::file_exists(fs::path(sitepath, "02-second-episode.html")))
tests/testthat/test-build_lesson.R:325: c("aio-01-introduction", "aio-02-second-episode"))
tests/testthat/test-build_lesson.R:342:test_that("episodes with HTML in the title are rendered correctly", {
tests/testthat/test-build_lesson.R:346: se <- readLines(fs::path(tmp, "episodes", "02-second-episode.Rmd"))
tests/testthat/test-build_lesson.R:348: writeLines(se, fs::path(tmp, "episodes", "02-second-episode.Rmd"))
tests/testthat/test-build_lesson.R:355: h2 <- expect_hashed(tmp, "02-second-episode.Rmd")
tests/testthat/test-build_lesson.R:357: expect_true(fs::file_exists(fs::path(sitepath, "02-second-episode.html")))
tests/testthat/test-build_lesson.R:361: readLines(fs::path(sitepath, "02-second-episode.html")),
tests/testthat/test-build_html.R:29: next_page = fs::path(res, "episodes", "01-introduction.Rmd")
tests/testthat/test-get_drafts.R:3: create_episode("new", add = FALSE, path = res)
tests/testthat/test-get_drafts.R:6:cli::test_that_cli("Default state reports all episodes published", {
tests/testthat/test-get_drafts.R:8: expect_snapshot(drf <- get_drafts(res, "episodes"))
tests/testthat/test-get_drafts.R:13:cli::test_that_cli("Draft episodes are and added episodes ignored", {
tests/testthat/test-get_drafts.R:15: reset_episodes(res)
tests/testthat/test-get_drafts.R:16: suppressMessages(set_episodes(res, get_episodes(res)[1], write = TRUE))
tests/testthat/test-get_drafts.R:17: expect_snapshot(drf <- get_drafts(res, "episodes"))
tests/testthat/test-get_drafts.R:23:cli::test_that_cli("No draft episodes reports all episodes published", {
tests/testthat/test-get_drafts.R:25: reset_episodes(res)
tests/testthat/test-get_drafts.R:26: suppressMessages(set_episodes(res, get_episodes(res), write = TRUE))
tests/testthat/test-get_drafts.R:27: expect_snapshot(drf <- get_drafts(res, "episodes"))
tests/testthat/test-get_syllabus.R:8: suppressMessages(s <- get_episodes(tmp))
tests/testthat/test-get_syllabus.R:9: set_episodes(tmp, s, write = TRUE)
tests/testthat/test-get_syllabus.R:12: expect_named(res, c("episode", "timings", "path"))
tests/testthat/test-get_syllabus.R:15: expect_equal(res$episode, c("Using RMarkdown", "Finish"))
tests/testthat/test-get_syllabus.R:21: create_episode("postroduction", path = tmp, add = TRUE)
tests/testthat/test-get_syllabus.R:23: expect_named(res, c("episode", "timings", "path", "questions"))
tests/testthat/test-get_syllabus.R:26: expect_equal(res$episode, c(rep("Using RMarkdown", 2), "Finish"))
tests/testthat/test-get_syllabus.R:32:test_that("episodes missing question blocks do not throw error", {
tests/testthat/test-get_syllabus.R:36: fs::path(tmp, "episodes", "break.md")
tests/testthat/test-get_syllabus.R:39: set_episodes(tmp, c(get_episodes(tmp), "break.md"), write = TRUE)
tests/testthat/test-get_syllabus.R:44: expect_equal(res$episode, c(rep("Using RMarkdown", 2), "Break", "Finish"))
tests/testthat/test-set_dropdown.R:35: suppressMessages(s <- get_episodes(tmp))
tests/testthat/test-set_dropdown.R:37: expect_null(set_episodes(tmp, s, write = TRUE))
tests/testthat/test-set_dropdown.R:38: expect_silent(s <- get_episodes(tmp))
tests/testthat/test-set_dropdown.R:42: no_episodes <- names(cfg)[names(cfg) != "episodes"]
tests/testthat/test-set_dropdown.R:43: expect_equal(cfg[no_episodes], get_config(tmp)[no_episodes])
tests/testthat/test-set_dropdown.R:48:test_that("new episodes will not add to the schedule by default", {
tests/testthat/test-set_dropdown.R:50: set_episodes(tmp, "01-introduction.Rmd", write = TRUE)
tests/testthat/test-set_dropdown.R:51: create_episode("new", path = tmp)
tests/testthat/test-set_dropdown.R:52: expect_equal(get_episodes(tmp), "01-introduction.Rmd", ignore_attr = TRUE)
tests/testthat/test-set_dropdown.R:57:test_that("get_episodes() returns episodes in dir if schedule is not set", {
tests/testthat/test-set_dropdown.R:59: reset_episodes(tmp)
tests/testthat/test-set_dropdown.R:60: suppressMessages(expect_message(s <- get_episodes(tmp)))
tests/testthat/test-set_dropdown.R:62: set_episodes(tmp, s[1], write = TRUE)
tests/testthat/test-set_dropdown.R:63: expect_equal(get_episodes(tmp), s[1], ignore_attr = TRUE)
tests/testthat/test-set_dropdown.R:68:cli::test_that_cli("set_episodes() will display the modifications if write is not specified", {
tests/testthat/test-set_dropdown.R:71: reset_episodes(tmp)
tests/testthat/test-set_dropdown.R:72: expect_snapshot(s <- get_episodes(tmp))
tests/testthat/test-set_dropdown.R:75: set_episodes(tmp, s, write = TRUE)
tests/testthat/test-set_dropdown.R:76: expect_equal(get_episodes(tmp), s, ignore_attr = TRUE)
tests/testthat/test-set_dropdown.R:78: expect_snapshot(set_episodes(tmp, s[1]))
tests/testthat/test-set_dropdown.R:79: expect_equal(get_episodes(tmp), s, ignore_attr = TRUE)
tests/testthat/test-set_dropdown.R:80: set_episodes(tmp, s[1], write = TRUE)
tests/testthat/test-set_dropdown.R:81: expect_equal(get_episodes(tmp), s[1], ignore_attr = TRUE)
tests/testthat/test-set_dropdown.R:85:test_that("set_episodes() will error if no proposal is defined", {
tests/testthat/test-set_dropdown.R:87: expect_error(set_episodes(tmp), "episodes must have an order")
tests/testthat/test-set_dropdown.R:92:test_that("adding episodes will concatenate the schedule", {
tests/testthat/test-set_dropdown.R:94: set_episodes(tmp, "01-introduction.Rmd", write = TRUE)
tests/testthat/test-set_dropdown.R:95: expect_equal(get_episodes(tmp), "01-introduction.Rmd")
tests/testthat/test-set_dropdown.R:96: create_episode("second-episode", add = TRUE, path = tmp)
tests/testthat/test-set_dropdown.R:98: expect_equal(get_episodes(tmp), c("01-introduction.Rmd", "03-second-episode.Rmd"), ignore_attr = TRUE)
tests/testthat/test-set_dropdown.R:100: sb <- create_sidebar(get_episodes(tmp, trim = FALSE))
tests/testthat/test-set_dropdown.R:103: expect_match(sb[2], "03-second-episode.html")
tests/testthat/test-set_dropdown.R:109: set_episodes(tmp, c("03-second-episode.Rmd", "01-introduction.Rmd"), write = TRUE)
tests/testthat/test-set_dropdown.R:110: expect_equal(get_episodes(tmp), c("03-second-episode.Rmd", "01-introduction.Rmd"), ignore_attr = TRUE)
tests/testthat/test-set_dropdown.R:112: sb <- create_sidebar(get_episodes(tmp, trim = FALSE))
tests/testthat/test-set_dropdown.R:114: expect_match(sb[1], "03-second-episode.html")
tests/testthat/test-set_dropdown.R:121: set_episodes(tmp, c("03-second-episode.Rmd", "01-introduction.Rmd"), write = TRUE)
tests/testthat/test-set_dropdown.R:123: expect_equal(get_episodes(tmp), c("03-second-episode.Rmd", "01-introduction.Rmd"))
tests/testthat/test-set_dropdown.R:125: expect_equal(get_episodes(tmp), c("03-second-episode.Rmd", "01-introduction.Rmd"))
tests/testthat/test-set_dropdown.R:131: set_episodes(tmp, "01-introduction.Rmd", write = TRUE)
tests/testthat/test-set_dropdown.R:132: expect_equal(get_episodes(tmp), "01-introduction.Rmd", ignore_attr = TRUE)
tests/testthat/test-set_dropdown.R:134: sb <- create_sidebar(get_episodes(tmp, trim = FALSE))
tests/testthat/test-set_dropdown.R:143: episodes <- xml2::xml_find_all(html,
tests/testthat/test-set_dropdown.R:145: links <- xml2::xml_attr(episodes, "href")
tests/testthat/_snaps/set_dropdown.md:50:# set_episodes() will display the modifications if write is not specified [plain]
tests/testthat/_snaps/set_dropdown.md:53: s <- get_episodes(tmp)
tests/testthat/_snaps/set_dropdown.md:55: i No schedule set, using Rmd files in 'episodes/' directory.
tests/testthat/_snaps/set_dropdown.md:56: > To remove this message, define your schedule in 'config.yaml' or use `set_episodes()` to generate it.
tests/testthat/_snaps/set_dropdown.md:61: set_episodes(tmp, s[1])
tests/testthat/_snaps/set_dropdown.md:63: episodes:
tests/testthat/_snaps/set_dropdown.md:66: -- Removed episodes ------------------------------------------------------------
tests/testthat/_snaps/get_dropdown.md:4: s <- get_dropdown(res, "episodes")
tests/testthat/_snaps/get_dropdown.md:6: i No schedule set, using Rmd files in 'episodes/' directory.
tests/testthat/_snaps/get_dropdown.md:7: > To remove this message, define your schedule in 'config.yaml' or use `set_episodes()` to generate it.
tests/testthat/_snaps/get_episode.md:1:# set_episode() will throw an error if an episode does not exist [plain]
tests/testthat/_snaps/get_episode.md:4: expect_error(set_episodes(res, bad, write = TRUE))
tests/testthat/_snaps/get_episode.md:6: episodes:
tests/testthat/_snaps/get_episode.md:10:# set_episode() will throw an error if an episode does not exist [ansi]
tests/testthat/_snaps/get_episode.md:13: expect_error(set_episodes(res, bad, write = TRUE))
tests/testthat/_snaps/get_episode.md:15: episodes:
tests/testthat/_snaps/get_episode.md:19:# set_episode() will throw an error if an episode does not exist [unicode]
tests/testthat/_snaps/get_episode.md:22: expect_error(set_episodes(res, bad, write = TRUE))
tests/testthat/_snaps/get_episode.md:24: episodes:
tests/testthat/_snaps/get_episode.md:28:# set_episode() will throw an error if an episode does not exist [fancy]
tests/testthat/_snaps/get_episode.md:31: expect_error(set_episodes(res, bad, write = TRUE))
tests/testthat/_snaps/get_episode.md:33: episodes:
tests/testthat/_snaps/get_episode.md:37:# get_episode() will throw a message about episode in draft [plain]
tests/testthat/_snaps/get_episode.md:40: drafty_out <- get_episodes(res)
tests/testthat/_snaps/get_episode.md:42: i Files are in draft: 'episodes/02-new.Rmd'
tests/testthat/_snaps/get_episode.md:44:# get_episode() will throw a message about episode in draft [ansi]
tests/testthat/_snaps/get_episode.md:47: drafty_out <- get_episodes(res)
tests/testthat/_snaps/get_episode.md:49: [36mi[39m [3m[3mFiles are in draft: [34m[3m[34mepisodes/02-new.Rmd[34m[3m[39m[3m[23m
tests/testthat/_snaps/get_episode.md:51:# get_episode() will throw a message about episode in draft [unicode]
tests/testthat/_snaps/get_episode.md:54: drafty_out <- get_episodes(res)
tests/testthat/_snaps/get_episode.md:56: ℹ Files are in draft: 'episodes/02-new.Rmd'
tests/testthat/_snaps/get_episode.md:58:# get_episode() will throw a message about episode in draft [fancy]
tests/testthat/_snaps/get_episode.md:61: drafty_out <- get_episodes(res)
tests/testthat/_snaps/get_episode.md:63: [36mℹ[39m [3m[3mFiles are in draft: [34m[3m[34mepisodes/02-new.Rmd[34m[3m[39m[3m[23m
tests/testthat/_snaps/get_episode.md:65:# get_episode() will throw a warning if an episode in config does not exist [plain]
tests/testthat/_snaps/get_episode.md:68: expect_error(get_episodes(res))
tests/testthat/_snaps/get_episode.md:70: episodes:
tests/testthat/_snaps/get_episode.md:74:# get_episode() will throw a warning if an episode in config does not exist [ansi]
tests/testthat/_snaps/get_episode.md:77: expect_error(get_episodes(res))
tests/testthat/_snaps/get_episode.md:79: episodes:
tests/testthat/_snaps/get_episode.md:83:# get_episode() will throw a warning if an episode in config does not exist [unicode]
tests/testthat/_snaps/get_episode.md:86: expect_error(get_episodes(res))
tests/testthat/_snaps/get_episode.md:88: episodes:
tests/testthat/_snaps/get_episode.md:92:# get_episode() will throw a warning if an episode in config does not exist [fancy]
tests/testthat/_snaps/get_episode.md:95: expect_error(get_episodes(res))
tests/testthat/_snaps/get_episode.md:97: episodes:
tests/testthat/_snaps/create_lesson.md:7: episodes/*html
tests/testthat/_snaps/create_lesson.md:35: episodes/*html
tests/testthat/_snaps/create_lesson.md:63: episodes/*html
tests/testthat/_snaps/create_lesson.md:91: episodes/*html
tests/testthat/_snaps/get_drafts.md:1:# Default state reports all episodes published [plain]
tests/testthat/_snaps/get_drafts.md:4: drf <- get_drafts(res, "episodes")
tests/testthat/_snaps/get_drafts.md:6: i All files in 'episodes/' published (config.yaml empty)
tests/testthat/_snaps/get_drafts.md:8:# Default state reports all episodes published [ansi]
tests/testthat/_snaps/get_drafts.md:11: drf <- get_drafts(res, "episodes")
tests/testthat/_snaps/get_drafts.md:13: [36mi[39m All files in [34m[34m[34mepisodes[34m/[34m[39m published (config.yaml empty)
tests/testthat/_snaps/get_drafts.md:15:# Default state reports all episodes published [unicode]
tests/testthat/_snaps/get_drafts.md:18: drf <- get_drafts(res, "episodes")
tests/testthat/_snaps/get_drafts.md:20: ℹ All files in 'episodes/' published (config.yaml empty)
tests/testthat/_snaps/get_drafts.md:22:# Default state reports all episodes published [fancy]
tests/testthat/_snaps/get_drafts.md:25: drf <- get_drafts(res, "episodes")
tests/testthat/_snaps/get_drafts.md:27: [36mℹ[39m All files in [34m[34m[34mepisodes[34m/[34m[39m published (config.yaml empty)
tests/testthat/_snaps/get_drafts.md:29:# Draft episodes are and added episodes ignored [plain]
tests/testthat/_snaps/get_drafts.md:32: drf <- get_drafts(res, "episodes")
tests/testthat/_snaps/get_drafts.md:34: i Files are in draft: 'episodes/02-new.Rmd'
tests/testthat/_snaps/get_drafts.md:36:# Draft episodes are and added episodes ignored [ansi]
tests/testthat/_snaps/get_drafts.md:39: drf <- get_drafts(res, "episodes")
tests/testthat/_snaps/get_drafts.md:41: [36mi[39m [3m[3mFiles are in draft: [34m[3m[34mepisodes/02-new.Rmd[34m[3m[39m[3m[23m
tests/testthat/_snaps/get_drafts.md:43:# Draft episodes are and added episodes ignored [unicode]
tests/testthat/_snaps/get_drafts.md:46: drf <- get_drafts(res, "episodes")
tests/testthat/_snaps/get_drafts.md:48: ℹ Files are in draft: 'episodes/02-new.Rmd'
tests/testthat/_snaps/get_drafts.md:50:# Draft episodes are and added episodes ignored [fancy]
tests/testthat/_snaps/get_drafts.md:53: drf <- get_drafts(res, "episodes")
tests/testthat/_snaps/get_drafts.md:55: [36mℹ[39m [3m[3mFiles are in draft: [34m[3m[34mepisodes/02-new.Rmd[34m[3m[39m[3m[23m
tests/testthat/_snaps/get_drafts.md:57:# No draft episodes reports all episodes published [plain]
tests/testthat/_snaps/get_drafts.md:60: drf <- get_drafts(res, "episodes")
tests/testthat/_snaps/get_drafts.md:62: i All files in 'episodes/' published
tests/testthat/_snaps/get_drafts.md:64:# No draft episodes reports all episodes published [ansi]
tests/testthat/_snaps/get_drafts.md:67: drf <- get_drafts(res, "episodes")
tests/testthat/_snaps/get_drafts.md:69: [36mi[39m All files in [34m[34m[34mepisodes[34m/[34m[39m published
tests/testthat/_snaps/get_drafts.md:71:# No draft episodes reports all episodes published [unicode]
tests/testthat/_snaps/get_drafts.md:74: drf <- get_drafts(res, "episodes")
tests/testthat/_snaps/get_drafts.md:76: ℹ All files in 'episodes/' published
tests/testthat/_snaps/get_drafts.md:78:# No draft episodes reports all episodes published [fancy]
tests/testthat/_snaps/get_drafts.md:81: drf <- get_drafts(res, "episodes")
tests/testthat/_snaps/get_drafts.md:83: [36mℹ[39m All files in [34m[34m[34mepisodes[34m/[34m[39m published
tests/testthat/test-manage_deps.R:133: writeLines("library(sessioninfo)", con = fs::path(lsn, "episodes", "si.R"))
tests/testthat/test-create_lesson.R:42: expect_true(fs::dir_exists(fs::path(tmp, "episodes")))
tests/testthat/test-create_lesson.R:43: expect_true(fs::dir_exists(fs::path(tmp, "episodes", "data")))
tests/testthat/test-create_lesson.R:44: expect_true(fs::dir_exists(fs::path(tmp, "episodes", "files")))
tests/testthat/test-create_lesson.R:45: expect_true(fs::dir_exists(fs::path(tmp, "episodes", "fig")))
tests/testthat/test-create_lesson.R:55: expect_true(fs::file_exists(fs::path(tmp, "episodes", "01-introduction.Rmd")))
tests/testthat/test-create_lesson.R:66: readLines(fs::path(tmp, "episodes", "01-introduction.Rmd")),
tests/testthat/test-create_lesson.R:67: readLines(template_episode())
tests/testthat/test-create_lesson.R:90:test_that("Episode validation works", {
tests/testthat/test-create_lesson.R:91: expect_true(check_episode(fs::path(tmp, "episodes", "01-introduction.Rmd")))
tests/testthat/helper-hash.R:4:# @param file the path to the episode to be hashed (in the episodes dir)
tests/testthat/helper-hash.R:6: expected_hash <- tools::md5sum(fs::path(path_episodes(path), file))
R/reset_episodes.R:10:#' get_episodes(tmp) # produces warning
R/reset_episodes.R:11:#' set_episodes(tmp, get_episodes(tmp), write = TRUE)
R/reset_episodes.R:12:#' get_episodes(tmp) # no warning
R/reset_episodes.R:13:#' reset_episodes(tmp)
R/reset_episodes.R:14:#' get_episodes(tmp) # produces warning again because there is no schedule
R/reset_episodes.R:15:reset_episodes <- function(path = ".") {
R/reset_episodes.R:20: values = yaml[names(yaml) != "episodes"])
R/options.R:32:#' episodes in draft status (i.e. episodes that are in the folder, but not in
R/get_drafts.R:23: folder <- c("episodes", "learners", "instructors", "profiles")
R/get_dropdown.R:10:#' @return a character vector of episodes in order of presentation
R/get_dropdown.R:17:#' get_episodes(tmp)
R/get_dropdown.R:25:get_episodes <- function(path = ".", trim = TRUE) {
R/get_dropdown.R:26: as.character(get_resource_list(path, trim, "episodes", warn = TRUE))
R/get_syllabus.R:7:#' @param questions if `TRUE`, the questions in the episodes will be added to
R/get_syllabus.R:9:#' @param use_built if `TRUE` (default), the rendered episodes will be used to
R/get_syllabus.R:24: # with each episode.
R/get_syllabus.R:26: sched <- .resources$get()[["episodes"]] %||%
R/get_syllabus.R:27: get_resource_list(path, trim = TRUE, subfolder = "episodes")
R/get_syllabus.R:32: cache_invalid <- !setequal(sched, names(lesson$episodes))
R/get_syllabus.R:36: episodes <- lesson$episodes[sched]
R/get_syllabus.R:38: quest <- if (questions) vapply(episodes, get_questions, character(1)) else NULL
R/get_syllabus.R:40: timings <- vapply(episodes, get_timings, numeric(1))
R/get_syllabus.R:41: titles <- vapply(episodes, get_titles, character(1))
R/get_syllabus.R:51: episode = c(titles, "Finish"),
R/create_lesson.R:26: fs::dir_create(fs::path(path, "episodes"))
R/create_lesson.R:27: fs::dir_create(fs::path(path, "episodes", "data"))
R/create_lesson.R:28: fs::dir_create(fs::path(path, "episodes", "files"))
R/create_lesson.R:29: fs::dir_create(fs::path(path, "episodes", "fig"))
R/create_lesson.R:65: cli::cli_status_update("{cli::symbol$arrow_right} Creating first episode ...")
R/create_lesson.R:66: ep <- create_episode("introduction", path = path)
R/create_lesson.R:67: cli::cli_alert_success("First episode created in {.file {ep}}")
R/create_episode.R:1:#' Create an Episode from a template
R/create_episode.R:3:#' @param title the title of the episode
R/create_episode.R:13:#' create_episode("getting-started", path = tmp)
R/create_episode.R:14:create_episode <- function(title, make_prefix = TRUE, add = FALSE, path = ".") {
R/create_episode.R:18: episodes <- fs::path_file(fs::dir_ls(path_episodes(path), regexp = "*.[Rr]?md"))
R/create_episode.R:19: suppressWarnings(prefix <- as.integer(sub("^([0-9]{2}).+$", "\\1", episodes)))
R/create_episode.R:24: copy_template("episode", fs::path(path, "episodes"), ename)
R/create_episode.R:26: suppressWarnings(sched <- get_episodes(path))
R/create_episode.R:27: set_episodes(path, c(sched, ename), write = TRUE)
R/create_episode.R:29: invisible(fs::path(path, "episodes", ename))
R/ci_build_markdown.R:20: # Set episodes to rebuild if the lockfile has changed.
R/check_lesson.R:40: validate_that(check_dir(path, "episodes")),
R/check_episode.R:3:check_episode <- function(path) {
R/check_episode.R:4: episode_name <- fs::path_file(path)
R/check_episode.R:11: validate_that(check_exists(fs::path_dir(path), episode_name)),
R/check_episode.R:14: # validate_that(check_episode_name(path))
R/check_episode.R:21: paste0("There were errors with the episode titled '", episode_name, "'.")
R/build_site.R:8:#' an episode whose slug is 01-introduction, then setting `slug =
R/build_site.R:42: # Find all the episodes and get their range
R/build_site.R:43: er <- range(grep("episodes/", db$file, fixed = TRUE))
R/build_site.R:49: if (!quiet) cli::cli_rule(cli::style_bold("Scanning episodes to rebuild"))
R/build_site.R:74: build_episode_html(
R/build_lesson.R:25:#' create_episode("first-script", path = tmp)
R/build_markdown.R:1:#' Build plain markdown from the RMarkdown episodes
R/build_markdown.R:18:#' @seealso [build_episode_md()]
R/build_markdown.R:30: episode_path <- path_episodes(path)
R/build_markdown.R:33: # Determine build status for the episodes ------------------------------------
R/build_markdown.R:67: artifacts <- get_artifacts(path, "episodes")
R/build_markdown.R:70: FUN = function(i) enforce_dir(fs::path(episode_path, i)),
R/build_markdown.R:94: # Render the episode files to the built directory --------------------------
R/build_markdown.R:100: build_episode_md(
R/build_markdown.R:147:remove_rendered_html <- function(episodes) {
R/build_markdown.R:148: htmls <- fs::path_ext_set(episodes, "html")
R/build_home.R:54: "{gsub('^[ ]', ' ', number)}<a href='{fs::path_file(path)}'>{episode}</a>"
R/build_aio.R:10:#' When an episode needs to be added to the AiO, this will insert the XML nodes
R/build_aio.R:11:#' from the episode contents in its own section inside the All In One page.
R/build_aio.R:13:#' @param name the name of the section, prefixed with `episode-`
R/build_aio.R:14:#' @param contents the episode contents from [get_content()]
R/build_aio.R:27:#' episode_content <- get_content("01-introduction", pkg = pkg)
R/build_aio.R:29:#' contents = episode_content, parent = aio)
R/build_episode.R:1:#' Build a single episode html file
R/build_episode.R:7:#' @param path_md the path to the episode markdown (not RMarkdown) file
R/build_episode.R:8:#' (usually via [build_episode_md()]).
R/build_episode.R:18:#' @param sidebar a character vector of links to other episodes to use for the
R/build_episode.R:19:#' sidebar. The current episode will be replaced with an index of all the
R/build_episode.R:20:#' chapters in the episode.
R/build_episode.R:21:#' @param date the date the episode was last built.
R/build_episode.R:27:#' @seealso [build_episode_md()], [build_lesson()], [build_markdown()], [render_html()]
R/build_episode.R:43:#' suppressMessages(set_episodes(tmp, get_episodes(tmp), write = TRUE))
R/build_episode.R:50:#' fun_file <- file.path(tmp, "episodes", "files", "fun.Rmd")
R/build_episode.R:61:#' res <- build_episode_md(fun_file, hash)
R/build_episode.R:67:#' build_episode_html(res, path_src = fun_file,
R/build_episode.R:72:build_episode_html <- function(path_md, path_src = NULL,
R/build_episode.R:131:#' @inheritParams build_episode_html
R/build_episode.R:170:#' Build an episode to markdown
R/build_episode.R:180:#' @param workdir the directory where the episode should be rendered
R/build_episode.R:189:#' @seealso [render_html()], [build_episode_html()]
R/build_episode.R:200:#' dir.create(fs::path(fun_dir, "episodes"), recursive = TRUE)
R/build_episode.R:201:#' fun_file <- file.path(fun_dir, "episodes", "fun.Rmd")
R/build_episode.R:209:#' res <- build_episode_md(fun_file, outdir = fun_dir, workdir = fun_dir)
R/build_episode.R:210:build_episode_md <- function(path, hash = NULL, outdir = path_built(path),
R/build_episode.R:240: func = callr_build_episode_md,