Skip to contents

Scaffolds the repository students download with usethis::use_course(): a working project with one numbered directory per chapter, plus a place for data.

Usage

create_course_exercises(
  path,
  title = NULL,
  author = NULL,
  schedule = NULL,
  open = rlang::is_interactive()
)

Arguments

path

Directory to create.

title

Course title, used in _quarto.yml and DESCRIPTION.

author

Author name.

schedule

Optional path to a schedule.md. When given, one numbered exercise directory is created per chapter, matching the book's spine.

open

Open the new project in RStudio or Positron?

Value

Invisibly, the path to the project.

Details

Exercises stay in their own repository rather than being folded into the book. They are a working environment — a local project with data and files students edit — which a rendered book chapter cannot be.

Examples

path <- file.path(withr::local_tempdir(), "my-course-exercises")
schedule <- system.file("extdata", "schedule.md", package = "rithmatist")
create_course_exercises(path, schedule = schedule, open = FALSE)
#> Error in check_path_is_directory(path_dir(path)): ✖ Directory /tmp/Rtmpe7cYU7/file1a72586f6505 does not exist.
list.files(file.path(path, "exercises"))
#> character(0)