#' @title Include Rmd in YAML Header
#'
#' @description Knit-and-merge
#'
#' @param file R Markdown file.
#' @param sep Line separator.
#' @param ... Arguments passed to \code{rmarkdown::\link[rmarkdown]{md_document}}
#'
#' @return Output lines.
#'
#' @examples
#' \dontrun{CHL5201::include_Rmd(input.Rmd)}
#'
#' @export
include_Rmd <- function(file, sep = "\n ", ...) {
assertthat::assert_that(is.character(sep))
assertthat::assert_that(fs::file_exists(file),
msg = "File does not exist! Please check the path.")
paste(readLines(file), collapse = sep)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.