Description Usage Arguments Value Examples
Create a Lesson
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | create_lesson(
lesson_name,
course_dir = ".",
verbose = TRUE,
md_file = NULL,
make_slide_deck = TRUE,
slide_id = NULL,
extract_code = FALSE,
rmd = extract_code,
open = FALSE,
template_slide_id = "143gvqcynq_bl7iVd2G9yjumwJJkAy0S6CyNCsrJ2LgE",
publish = TRUE,
add_number = TRUE,
use_google_drive = FALSE,
...
)
create_lessons_from_book(
course_dir = ".",
verbose = TRUE,
make_slide_deck = FALSE,
...
)
|
lesson_name |
Name of the Lesson to create. This should be human-readable and will be the title of your lesson in your course. |
course_dir |
directory with course materials |
verbose |
print diagnostic messages |
md_file |
Output markdown file to create. If not specified,
will take the |
make_slide_deck |
Create a slide deck on Google Slides if no link is provided. |
slide_id |
ID to slide deck on Google Slides. Caution, this will publish the slide deck to the web. |
extract_code |
If you have text with |
rmd |
Should an Rmd (Rmarkdown) be made versus a Markdown? |
open |
should the file be opened for editing? |
template_slide_id |
Slide ID for a template. This template will be copied to your new slide deck. |
publish |
should the slide be published so slides can be included in the markdown? |
add_number |
Add a prefix to the file name, such as '00_' for the first file |
use_google_drive |
passed to |
... |
arguments passed to |
A list of the created markdown manuscript file and script files.
create_lessons_from_book
will return a list of these lists,
one for each lesson in the Book.txt
file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | root_path = tempfile()
course_name = "test"
sc = create_course(course_name, root_path)
verbose = TRUE
out =create_lesson(lesson_name = "how to Do Things",
course_dir = sc$course_dir,
make_slide_deck = FALSE,
open = FALSE)
dir(sc$man_path)
dir(sc$scr_path)
readLines(sc$book_txt, warn = FALSE)
readLines(out$md_file)
in_ci <- function() {
nzchar(Sys.getenv("CI"))
}
## Not run:
# requires authorization
root_path = tempfile()
course_name = "test"
sc = create_course(course_name, root_path)
verbose = TRUE
out = create_lesson(lesson_name = "how to Do Things",
course_dir = sc$course_dir,
make_slide_deck = !in_ci(),
open = interactive())
dir(sc$man_path)
dir(sc$scr_path)
readLines(sc$book_txt, warn = FALSE)
readLines(out$md_file, warn = FALSE)
## End(Not run)
root_path = tempfile()
course_name = "test"
sc = create_course(course_name, root_path)
verbose = TRUE
x = system.file("extdata", "Book.txt", package = "didactr")
file.copy(x, sc$book_txt, overwrite = TRUE)
course_dir = sc$course_dir
res = create_lessons_from_book(course_dir = sc$course_dir, open = FALSE,
make_slide_deck = FALSE
)
dir(sc$man_path)
dir(sc$scr_path)
readLines(sc$book_txt)
readLines(res[[3]]$md_file)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.