Skip to content

Commit

Permalink
Extract prepare_tutorial_cache_from_html()
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Mar 18, 2022
1 parent 05acf75 commit 3266c5c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion R/tutorial-state.R
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,14 @@ prepare_tutorial_cache_from_source <- function(path_rmd, render_args = NULL) {
do.call(rmarkdown::render, render_args)
})

prepare_tutorial_cache_from_html(path_html, path_rmd)
}

prepare_tutorial_cache_from_html <- function(path_html, path_rmd = NULL) {
if (!utils::file_test("-f", path_html)) {
rlang::abort(sprintf(gettext("'%s' is not an existing file"), path_html))
}

prerendered_extract_context <-
getFromNamespace("shiny_prerendered_extract_context", ns = "rmarkdown")

Expand Down Expand Up @@ -352,4 +360,3 @@ prepare_tutorial_cache_from_source <- function(path_rmd, render_args = NULL) {

get_tutorial_info(NULL, tutorial_path = path_rmd)
}

0 comments on commit 3266c5c

Please sign in to comment.