theme_light: #' Include Content From a File #' #' Load rendered RMarkdown...

View source: R/golem_utils_ui.R

theme_lightR Documentation

#' Include Content From a File #' #' Load rendered RMarkdown from a file and turn into HTML. #' #' @rdname includeRMarkdown #' @export #' #' @importFrom rmarkdown render #' @importFrom markdown markdownToHTML #' @importFrom htmltools HTML includeRMarkdown <- function(path) md <- tempfile(fileext = '.md') on.exit(unlink(md),add = TRUE) rmarkdown::render( path, output_format = 'md_document', output_dir = tempdir(), output_file = md,quiet = TRUE ) html <- markdown::markdownToHTML(md, fragment.only = TRUE) Encoding(html) <- "UTF-8" return(HTML(html))

Description

#' Include Content From a File #' #' Load rendered RMarkdown from a file and turn into HTML. #' #' @rdname includeRMarkdown #' @export #' #' @importFrom rmarkdown render #' @importFrom markdown markdownToHTML #' @importFrom htmltools HTML includeRMarkdown <- function(path)

md <- tempfile(fileext = '.md')

on.exit(unlink(md),add = TRUE)

rmarkdown::render( path, output_format = 'md_document', output_dir = tempdir(), output_file = md,quiet = TRUE )

html <- markdown::markdownToHTML(md, fragment.only = TRUE)

Encoding(html) <- "UTF-8"

return(HTML(html))

Usage

theme_light()

joseph-shaw/OpenTrack documentation built on Dec. 1, 2022, 9:54 a.m.