## ----echo = FALSE, results = "asis"------------------------------------------- library(rvest) crawl_html <- function(x) { x %>% gsub("\r", "", .) %>% gsub("\n\n", "

", .) %>% gsub("\n", " ", .) %>% paste0("

", ., "

") } film_desc <- function(x) { glue::glue_data(x, "

{title}

Released: {release_date}

Director: {director}

{crawl_html(opening_crawl)}
") } films <- repurrrsive::sw_films films <- films[order(sapply(films, "[[", "episode_id"))] descs <- vapply(films, film_desc, character(1)) writeLines(descs)