Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions R/lesson_to_html.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ makechunk_silent <- function(item) {
paste0(out, collapse="\n")
}

makelink <- function(item) {
out <- c("[link](", item, ")")
paste0(out, collapse="\n")
}


#' @importFrom stringr str_split str_trim
makemult <- function(item) {
answers <- unlist(str_split(item, ";"))
Expand Down Expand Up @@ -53,6 +59,16 @@ makemd.script <- function(unit) {
sep = "\n\n")
}

makemd.video <- function(unit) {
paste(unit[['Output']],makelink(unit[['VideoLink']]),
sep="\n\n")
}

makemd.figure <- function(unit) {
paste(unit[['Output']], "Image not displayed",
sep="\n\n")
}

#' Turn a swirl lesson into a pretty webpage
#'
#' Create an easily shareable HTML version of your swirl lesson. This function
Expand Down