Convert Website Course to Leanpub

website_to_embed_leanpub(
  path = ".",
  chapt_img_key = NULL,
  html_page = file.path(base_url, "index.html"),
  base_url = NULL,
  default_img = NULL,
  render = TRUE,
  output_dir = "manuscript",
  make_book_txt = FALSE,
  quiz_dir = "quizzes",
  run_quiz_checks = FALSE,
  remove_resources_start = FALSE,
  verbose = TRUE,
  footer_text = ""
)

Arguments

path

path to the bookdown or quarto course repository, must have a `_bookdown.yml` or `_quarto.yml` file

chapt_img_key

File path to a TSV whose contents are the chapter urls (`url`), the chapter titles (`chapt_title`), the file path to the image to be used for the chapter (`img_path`). Column names `url`, `chapt_title`, and `img_path` must be used. If no chapter title column supplied, the basename of the url will be used, If no image column supplied, default image used.

html_page

The file path of the rendered index.html file

base_url

The base url of where the chapters are published -- the url to provide to the iframe in Leanpub e.g. https://jhudatascience.org/OTTR_Template/coursera

default_img

A google slide link to the default image to be used for all chapters

render

if `TRUE`, then [bookdown::render_book()] will be run on each Rmd.

output_dir

output directory to put files. It should likely be relative to path

make_book_txt

Should [ottrpal::course_to_book_txt()] be run to create a `Book.txt` in the output directory?

quiz_dir

directory that contains the quiz .md files that should be checked and incorporated into the Book.txt file. If you don't have quizzes, set this to NULL

run_quiz_checks

TRUE/FALSE run quiz checks

remove_resources_start

remove the word `resources/` at the front of any image path.

verbose

print diagnostic messages

footer_text

Optionally can add a bit of text that will be added to the end of each file before the references section.

clean_up

TRUE/FALSE the old output directory should be deleted and everything created fresh.

Value

A directory of output files in a folder 'manuscript' for publishing on Leanpub.

Examples

if (FALSE) {

ottrpal::website_to_embed_leanpub(
  base_url = "https://jhudatascience.org/OTTR_Template/",
  make_book_txt = TRUE,
  quiz_dir = NULL
)
}