|
| 1 | +render_slides <- function(.qmd_file) { |
| 2 | + usethis::ui_done("Rendering {usethis::ui_path(.qmd_file)}") |
| 3 | + render_quietly(.qmd_file) |
| 4 | +} |
| 5 | + |
| 6 | +render_quietly <- function(.qmd_file) { |
| 7 | + pdf_file <- fs::path( |
| 8 | + "slides", |
| 9 | + "pdf", |
| 10 | + fs::path_ext_set(fs::path_file(.qmd_file), "pdf") |
| 11 | + ) |
| 12 | + |
| 13 | + html_file <- normalizePath(path_ext_set(.qmd_file, ".html")) |
| 14 | + |
| 15 | + suppress(quarto::quarto_render(.qmd_file, quiet = TRUE)) |
| 16 | + suppress(renderthis::to_pdf(html_file, pdf_file)) |
| 17 | +} |
| 18 | + |
| 19 | +suppress <- function(code) { |
| 20 | + suppressMessages( |
| 21 | + suppressWarnings( |
| 22 | + suppressPackageStartupMessages( |
| 23 | + code |
| 24 | + ) |
| 25 | + ) |
| 26 | + ) |
| 27 | +} |
| 28 | + |
| 29 | +slides <- c( |
| 30 | + "00-intro.qmd", |
| 31 | + "01-causal_modeling_whole_game.qmd", |
| 32 | + "02-when-standard-methods-succeed.qmd", |
| 33 | + "03-causal-inference-with-group-by-and-summarise.qmd", |
| 34 | + "04-dags.qmd", |
| 35 | + "05-quartets.qmd", |
| 36 | + "06-pscores.qmd", |
| 37 | + "07-using-pscores.qmd", |
| 38 | + "08-pscore-diagnostics.qmd", |
| 39 | + "09-outcome-model.qmd", |
| 40 | + "10-continuous-g-comp.qmd", |
| 41 | + "11-tipr.qmd", |
| 42 | + "12-whole_game-2.qmd", |
| 43 | + "13-bonus-selection-bias.qmd", |
| 44 | + "14-bonus-continuous-pscores.qmd", |
| 45 | + "15-bonus-ml-for-causal.qmd" |
| 46 | +) |
| 47 | + |
| 48 | +purrr::walk(slides, render_slides) |
0 commit comments