blob: 9c29ddbb7288a9972dfb2a0a8d21b9b99ca3a07e [file] [log] [blame]
#' Rmarkdown Format
#'
#' @description If the export format of the Rmarkdown document exist,
#'
#' @importFrom rmarkdown metadata
#'
#' @export
rmd_format <- function(){
rmd_output_metadata <- metadata$output
rmd_fmt <- ifelse(
is.null(rmd_output_metadata),
"markdown", ifelse(
rmd_output_metadata %in% c("html_document", "rmarkdown::html_vignette"),
"html",ifelse(
rmd_output_metadata %in% c("pdf_document", "rmarkdown::tufte_handout"),
"latex", "markdown"
)))
return(rmd_fmt)
}