Hao Zhu | e0a36a8 | 2015-11-23 15:35:20 -0500 | [diff] [blame] | 1 | #' Rmarkdown Format |
| 2 | #' |
| 3 | #' @description If the export format of the Rmarkdown document exist, |
| 4 | #' |
| 5 | #' @importFrom rmarkdown metadata |
| 6 | #' |
| 7 | #' @export |
| 8 | |
| 9 | rmd_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 | } |