#' Helper functions to include a (R)markdown documents in another
#' Rmarkdown document
#'
#' @details
#' `rmd_child()` helps include an Rmarkdown document as a child. You can use
#' it likes this:
#' ````
#' ```{r child = rmd2rd::rmd_child("another.Rmd)}
#' ```
#' ````
#'
#' @param path Path to the (R)md file.
#' @return The path of the transformed Rmd child document.
#'
#' @export
rmd_child <- function(path) {
stopifnot(is_string(path), file.exists(path))
path
}
process_links <- function(path) {
tmp <- tempfile(fileext = ".Rmd")
lines <- readLines(path)
txt <- paste(lines, collapse = "\n")
esc <- add_linkrefs_to_md(txt)
lines2 <- strsplit(esc, "\n", fixed = TRUE)[[1]]
writeLines(lines2, tmp)
tmp
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.