Package 'shunyata'

Title: Deploy Empty Field Teaching Material
Description: This package helps set up new teaching material and deploy courses based on the Empty Field teaching workflow.
Authors: Malcolm Barrett [aut, cre]
Maintainer: Malcolm Barrett <[email protected]>
License: MIT + file LICENSE
Version: 0.0.1
Built: 2024-10-31 22:09:17 UTC
Source: https://github.com/emptyfield-ds/shunyata

Help Index


Open rendered, hostes slides

Description

Open rendered, hostes slides

Usage

browse_slides(.module)

Arguments

.module

the name of the module


Check solutions

Description

Check solutions hosted in emptyfield-ds/solutions

Usage

check_solutions(.file = NULL)

check_shiny_solutions(.file = NULL)

Arguments

.file

The path of the files to check. If NULL, searches directory for relevant files.


Create a new teaching module

Description

Create a new directory with R Markdown files for slides, exercises, and solutions.

Usage

create_module(
  module_dir,
  module_title,
  module_subtitle = "",
  include_exercises = TRUE,
  include_solutions = TRUE,
  include_img = TRUE
)

Arguments

module_dir

The directory name. Also the file name of the slides file.

module_title

The title of the module

module_subtitle

The subtitle of the module

include_exercises

Include exercises.qmd?

include_solutions

Include solutions.qmd?

include_img

Include an ⁠img/⁠ folder?

Value

module_dir, invisibly.


Dehydrate and rehydrate rproj files for safe project hygiene

Description

Dehydrate and rehydrate rproj files for safe project hygiene

Usage

dehydrate_rproj(dir)

rehydrate_rproj(dir)

Arguments

dir

The project directory

Value

a filename of either .Rproj or .dehydrated_Rproj


Copy a teaching package to a temporary directory and open it in RStudio

Description

Copy a teaching package to a temporary directory and open it in RStudio

Usage

open_temp_module(module, github = TRUE, open = interactive())

Arguments

module

The path to a local module or the name of a repo on emptyfile-ds

github

Use the copy of the module on GitHub?

open

Open in RStudio?

Value

Invisibly, the temporary directory where the module package has been copied


Write a path to the teaching warehouse

Description

path_warehouse() uses the shunyata.teaching_warehouse option to assemble an path to a given module.

Usage

path_warehouse(...)

Arguments

...

Additional path details passed to fs::path().

Value

A path

Examples

path_warehouse("purrr_basics")

Render Module Slides

Description

Render Module Slides

Usage

render_slides(dir, qmd_name = NULL, render = TRUE)

Arguments

dir

The directory where the module is located

qmd_name

The name of Quarto file. By default, assumes that it is the same as dir with a .qmd extension.

render

Logical. Render the Quarto file?

Value

Invisibly, the path to the rendered PDF


Archive an RStudio Cloud Course

Description

rsc_archive_course() removes members except for rsc_user_id, moving space member projects to their own workspace.

Usage

rsc_archive_course(
  space_id,
  rsc_user_id = getOption("shunyata.rscloud_user_id")
)

Arguments

space_id

The RStudio Cloud space ID

rsc_user_id

The user ID of the course lead

Value

Invisibly, the course ID


Sanitize module

Description

Remove files and directories that aren't needed for the student copy

Usage

sanitize_module(
  module,
  new_path = NULL,
  rm_files = c("theme.css", "kakashi.css", "solutions.qmd"),
  rm_dir = c("img", "libs", "_extensions"),
  overwrite = FALSE,
  build_slides = TRUE,
  qmd_name = NULL
)

Arguments

module

The name of the module

new_path

Where to copy the sanitized directory

rm_files

Which files to remove

rm_dir

Which directories to remove

overwrite

Overwrite the sanitized module if it already exists?

build_slides

Logical. Render the slides?

qmd_name

The name of Quarto file. By default, assumes that it is the same as dir with a .qmd extension.

Value

invisibly, the path of the new module


Sync a module to GitHub

Description

sync_module() takes a raw teaching module, renders slides, sanitizes, and syncs with the existing GitHub repo for the module. Use with path_warehouse().

Usage

sync_module(.dir)

Arguments

.dir

The path to the module


Use course template

Description

A wrapper around usethis::use_template to use templates in this package.

Usage

use_course_template(
  template,
  save_as = template,
  data = list(),
  ignore = FALSE,
  open = FALSE
)

Arguments

template

Path to template file relative to ⁠templates/⁠ directory within package; see details.

save_as

Path of file to create, relative to root of active project. Defaults to template

data

A list of data passed to the template.

ignore

Should the newly created file be added to .Rbuildignore?

open

Open the newly created file for editing? Happens in RStudio, if applicable, or via utils::file.edit() otherwise.


Add CC-by-A License to Repo README

Description

use_edu_cca_license() adds a Creative Commons Attribution 4.0 International License to the README of an educational repository.

Usage

use_edu_cca_license(proj = usethis::proj_get())

Arguments

proj

The directory of the project, by default the usethis project.

Value

Invisibly, the path to the README


Create a Bare-Bones Repo on Empty Field DS

Description

use_ef_github() creates a bare-bones repo intended for use with sync_module()

Usage

use_ef_github(repo_name, private = FALSE)

Arguments

repo_name

The name of the repo to be created

private

Logical. Should the repo be private?

Value

Opens the URL of the repo


Manage module dependencies

Description

read_deps() pulls the package dependencies in .deps for modules from GitHub

Usage

write_deps(deps, path = ".")

detect_deps(path)

read_deps(modules)

Arguments

deps

A vector of dependencies

path

A path to the module

modules

A vector of modules

Value

A vector of module dependencies


Zip modules to upload to RStudio Cloud

Description

zip_modules() zips modules in a directory for upload to RStudio Cloud, e.g. the mastering_r_for_epi repository.

Usage

zip_modules()

Value

invisibly, a vector of directories