blob: 9c29ddbb7288a9972dfb2a0a8d21b9b99ca3a07e [file] [log] [blame]
Hao Zhue0a36a82015-11-23 15:35:20 -05001#' Rmarkdown Format
2#'
3#' @description If the export format of the Rmarkdown document exist,
4#'
5#' @importFrom rmarkdown metadata
6#'
7#' @export
8
9rmd_format <- function(){
10 rmd_output_metadata <- metadata$output
11 rmd_fmt <- ifelse(
12 is.null(rmd_output_metadata),
13 "markdown", ifelse(
14 rmd_output_metadata %in% c("html_document", "rmarkdown::html_vignette"),
15 "html",ifelse(
16 rmd_output_metadata %in% c("pdf_document", "rmarkdown::tufte_handout"),
17 "latex", "markdown"
18 )))
19 return(rmd_fmt)
20}