create_lesson: Create a carpentries lesson

View source: R/create_lesson.R

create_lessonR Documentation

Create a carpentries lesson

Description

This will create a boilerplate directory structure for a Carpentries lesson and initialize a git repository.

Usage

create_lesson(
  path,
  name = fs::path_file(path),
  rmd = TRUE,
  rstudio = rstudioapi::isAvailable(),
  open = rlang::is_interactive()
)

Arguments

path

the path to the new lesson folder

name

the name of the lesson. If not provided, the folder name will be used.

rmd

logical indicator if the lesson should use R Markdown (TRUE, default), or if it should use Markdown (FALSE). Note that lessons can be converted to use R Markdown at any time by adding a file with the .Rmd file extension in the lesson.

rstudio

create an RStudio project (defaults to if RStudio exits)

open

if interactive, the lesson will open in a new editor window.

Value

the path to the new lesson

Examples

tmp <- tempfile()
on.exit(unlink(tmp))
lsn <- create_lesson(tmp, name = "This Lesson", open = FALSE)
lsn

zkamvar/sandpaper documentation built on Jan. 26, 2023, 1:35 a.m.