library(rmarkdown)
skip_if_not(rmarkdown::pandoc_available())
skip_if_not(pandoc_version() >= numeric_version("2"))
str <- c(
"#' ---",
"#' output: officedown::rdocx_document",
"#' ---",
"",
"mtcars",
""
)
filename <- tempfile(fileext = ".R")
writeLines(str, filename, useBytes = TRUE)
test_that("rendering R file", {
docx_file <- tempfile(fileext = ".docx")
expect_true(render_rmd(filename, output_file = docx_file))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.