set_dropdown: Set the order of items in a dropdown menu

View source: R/set_dropdown.R

set_dropdownR Documentation

Set the order of items in a dropdown menu

Description

Set the order of items in a dropdown menu

Usage

set_dropdown(path = ".", order = NULL, write = FALSE, folder)

set_episodes(path = ".", order = NULL, write = FALSE)

set_learners(path = ".", order = NULL, write = FALSE)

set_instructors(path = ".", order = NULL, write = FALSE)

set_profiles(path = ".", order = NULL, write = FALSE)

Arguments

path

path to the lesson. Defaults to the current directory.

order

the files in the order presented (with extension)

write

if TRUE, the schedule will overwrite the schedule in the current file.

folder

one of four folders that sandpaper recognises where the files listed in order are located: episodes, learners, instructors, profiles.

Examples


tmp <- tempfile()
create_lesson(tmp, "test lesson", open = FALSE, rmd = FALSE)
# Change the title and License
set_config(c(title = "Absolutely Free Lesson", license = "CC0"),
  path = tmp,
  write = TRUE
)
create_episode("using-R", path = tmp, open = FALSE)
print(sched <- get_episodes(tmp))

# reverse the schedule
set_episodes(tmp, order = rev(sched))
# write it
set_episodes(tmp, order = rev(sched), write = TRUE)

# see it
get_episodes(tmp)


zkamvar/sandpaper documentation built on Sept. 5, 2024, 6:21 a.m.