R/Rmd2html.R

Defines functions Rmd2html

Rmd2html <- function(file) {

    x <- readLines(file)

    header <- grep("^---$", x)

    knit(file)
    markdownToHTML(gsub("Rmd$", "md", file),
                   output = gsub("Rmd$", "html", file),
                   fragment.only = TRUE)

    rval <- c(x[header[1]:header[2]], " ", readLines(gsub("Rmd$", "html", file)))

    rval
}
    

Try the pkg2html package in your browser

Any scripts or data that you put into this service are public.

pkg2html documentation built on July 14, 2021, 3 p.m.