rmd2slidy | R Documentation |
Creates accessible html slidy presentations using R markdown's
slidy_presentation
argument to
render
. Zip archives of the html files may be
created.
rmd2slidy(
x,
zip = if (length(x) == 1 & !add) FALSE else TRUE,
pdf = FALSE,
zip_pdf = zip,
pdf_args = list(),
add = FALSE,
quiet = TRUE,
rm_html = FALSE,
rm_pdf = FALSE,
inc_rmd = FALSE,
params = NULL,
...
)
x |
A character vector containing the names (no extension) of
the |
zip |
A logical scalar or character vector indicating whether html
files should be put into a zip archive. If |
pdf |
A logical scalar. If |
zip_pdf |
As |
pdf_args |
A list of arguments passed to
|
add |
A logical scalar that determines what happens if the output
zip file already exists. If |
quiet |
Argument of the same name passed to
|
rm_html |
A logical scalar. If |
rm_pdf |
A logical scalar. If |
inc_rmd |
A logical scalar. If |
params |
A list of named parameters to pass as the argument
|
... |
Additional arguments passed to
If This function is not vectorised with respect to arguments in
|
Information such as title
, author
, lang
etc in
the YAML header in the Rmd file are used but output
is ignored.
The simplest setup is to have the .Rmd
files in the current
working directory, in which case rmd2slidy()
will create slidy
presentations from all these Rmd files, but the .Rmd
files may be
in different directories.
The render
function, with the argument
output_file =
slidy_presentation
creates the slidy html files.
In addition to creating the html files, and perhaps zip files, a list containing the following (character vector) components is returned invisibly:
files |
(absolute) paths and file names of the files added to a zip file. |
zips |
(relative) paths and names of all the zip files. |
rmd2word
, rmd2word
,
rmd2ioslides
, rmd2html
for other output
formats.
The accessr package page on Github.
# Create a slidy presentation from example.Rmd
got_hux <- requireNamespace("huxtable", quietly = TRUE)
got_flex <- requireNamespace("flextable", quietly = TRUE)
got_pandoc <- rmarkdown::pandoc_available("1.14")
got_all <- got_hux && got_flex && got_pandoc
# This example needs packages huxtable and flextable
if (got_all) {
ex_file <- system.file(package = "accessr", "examples", "example.Rmd")
file.copy(ex_file, tdir <- tempdir(check = TRUE), overwrite = TRUE)
ex_file <- list.files(tdir, pattern = "example.Rmd", full.names = TRUE)
ex_file <- sub(".Rmd", "", ex_file)
rmd2slidy(ex_file)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.