Skip to contents

The create_deck() function generates a set of flashcards with randomly ordered pairs of terms and descriptions from a vector of functions provided by the user. The function outputs reveal.js presentation as an HTML file. If running in RStudio, the flashcards are output to the viewer. Otherwise, they are output to a web browser.

Usage

create_deck(
  x,
  title = NULL,
  termsfirst = TRUE,
  package = TRUE,
  theme = "moon",
  file = NULL,
  fontsize = "default",
  fontcolor = NULL,
  linkcolor = NULL,
  use_browser = FALSE
)

Arguments

x

Name of pre-existing flashcard deck or path and name of CSV file containing terms and descriptions

title

Title provided for flashcard deck. Defaults to "Custom deck" if not provided.

termsfirst

Logical indicating whether to show terms first (TRUE) or descriptions first (FALSE)

package

Logical indicating whether to include package name in term

theme

Name of reveal.js theme to use for flashcards

file

Path and file name used to save flashcard deck locally (must save as HTML)

fontsize

Base font size for presentation. Acceptable values include "default" (500%), "large" (700%), and "small" (300%). Custom values can be set as percentages (e.g., "250%").

fontcolor

Font color for non-link text. Can be R color name, HTML color name, or hex code.

linkcolor

Font color for link text. Can be R color name, HTML color name, or hex code.

use_browser

Logical indicating whether to show the presentation in the RStudio viewer when available (FALSE) or the system's default browser (TRUE)

Value

An HTML file of terms and descriptions rendered in the RStudio viewer or web browser.

See also

Other functions for creating decks: flashcard()

Examples

if (FALSE) { # interactive()
# \donttest{
# Display terms then descriptions
my_functions <- c("as_tibble()", "bind_rows()", "c()")
create_deck(x = my_functions)

# Customize the title
create_deck(x = my_functions, title = "My deck")

# Save the HTML version of the flashcard deck locally
create_deck(x = my_functions, title = "My deck", file = "my_deck.html")
# }
}