- insert_chapter_script(config, 'before'),
- insert_chapter_script(config, 'after')
- )
- rmarkdown::render(main, output_format, ..., clean = clean, envir = envir, encoding = 'UTF-8')
- }
-
- render_new_session = function(files, main, config, output_format, clean, envir, ...) {
-
- # save a copy of render arguments in a temp file
- render_args = tempfile('render', '.', '.rds')
- on.exit(unlink(render_args), add = TRUE)
- saveRDS(
- list(output_format = output_format, ..., clean = FALSE, envir = envir),
- render_args
- )
- # an RDS file to save all the metadata after compiling each Rmd
- render_meta = with_ext(main, '.rds')
-
- files_md = output_path(with_ext(files, '.md'))
- # copy pure Markdown input files to output directory; no need to render() them
- for (i in which(grepl('[.]md$', files) & files != files_md))