diff --git a/R/rmd2html.R b/R/rmd2html.R index 43ea0fc..4b9a718 100644 --- a/R/rmd2html.R +++ b/R/rmd2html.R @@ -57,8 +57,9 @@ #' the YAML header in the Rmd file are used but \code{output} is ignored. #' #' The simplest setup is to have the \code{.Rmd} files in the current -#' working directory, but it is possible to have the \code{.Rmd} files in -#' different directories. +#' working directory, in which case `rmd2html()` will create HTML documents +#' from all these Rmd files, the \code{.Rmd} files may be in different +#' directories. #' #' The \code{\link[rmarkdown]{render}} function, with the argument #' \code{output_file =} \code{\link[rmarkdown]{html_document}} @@ -87,14 +88,6 @@ #' ex_file <- sub(".Rmd", "", ex_file) #' rmd2html(ex_file) #' } -#' -#' \dontrun{ -#' # Create HTML documents from your files file1.Rmd and file2.Rmd -#' rmd2html(c("file1", "file2")) -#' -#' # Create HTML documents from all Rmd files in your working directory -#' rmd2html() -#' } #' @export rmd2html <- function(x, zip = if (length(x) == 1 & !add) FALSE else TRUE, pdf = FALSE, pdf_args = list(), zip_pdf = zip, diff --git a/R/rmd2ioslides.R b/R/rmd2ioslides.R index 4a24d7c..51413ee 100644 --- a/R/rmd2ioslides.R +++ b/R/rmd2ioslides.R @@ -70,9 +70,10 @@ #' @details Information such as \code{title}, \code{author}, \code{lang} etc in #' the YAML header in the Rmd file are used but \code{output} is ignored. #' -#' The simplest setup is to have the \code{.Rmd} files in the current -#' working directory, but it is possible to have the \code{.Rmd} files in -#' different directories. +#' The simplest setup is to have the \code{.Rmd} files in the current +#' working directory, in which case `rmd2ioslides()` will create ioslides +#' presentations from all these Rmd files, but the \code{.Rmd} files may be +#' in different directories. #' #' The \code{\link[rmarkdown]{render}} function, with the argument #' \code{output_file =} \code{\link[rmarkdown]{ioslides_presentation}} @@ -135,14 +136,6 @@ #' ex_file <- sub(".Rmd", "", ex_file) #' rmd2ioslides(ex_file) #' } -#' -#' \dontrun{ -#' # Create ioslides presentations from your files file1.Rmd and file2.Rmd -#' rmd2ioslides(c("file1", "file2"), inc_word = TRUE) -#' -#' # Create ioslides presentations from all Rmd files in your working directory -#' rmd2ioslides() -#' } #' @export rmd2ioslides <- function(x, zip = if (length(x) == 1 & !add) FALSE else TRUE, pdf = FALSE, zip_pdf = zip, pdf_args = list(), diff --git a/R/rmd2many.R b/R/rmd2many.R index 0bc6876..6093e6d 100644 --- a/R/rmd2many.R +++ b/R/rmd2many.R @@ -88,11 +88,6 @@ #' ex_file <- sub(".Rmd", "", ex_file) #' rmd2many(ex_file, params = list(hide = TRUE), pdf = FALSE, zip = TRUE) #' } -#' -#' \dontrun{ -#' # Create multiple documents files from your files file1.Rmd and file2.Rmd -#' rmd2many(c("file1", "file2")) -#' } #' @export rmd2many <- function(x, outputs = c("ioslides", "word"), slide_level = 1, css = "black", add18 = TRUE, pdf = TRUE, diff --git a/R/rmd2slidy.R b/R/rmd2slidy.R index 76525c2..ef1c72e 100644 --- a/R/rmd2slidy.R +++ b/R/rmd2slidy.R @@ -69,8 +69,9 @@ #' the YAML header in the Rmd file are used but \code{output} is ignored. #' #' The simplest setup is to have the \code{.Rmd} files in the current -#' working directory, but it is possible to have the \code{.Rmd} files in -#' different directories. +#' working directory, in which case `rmd2slidy()` will create slidy +#' presentations from all these Rmd files, but the \code{.Rmd} files may be +#' in different directories. #' #' The \code{\link[rmarkdown]{render}} function, with the argument #' \code{output_file =} \code{\link[rmarkdown]{slidy_presentation}} @@ -99,14 +100,6 @@ #' ex_file <- sub(".Rmd", "", ex_file) #' rmd2slidy(ex_file) #' } -#' -#' \dontrun{ -#' # Create slidy presentations from your files file1.Rmd and file2.Rmd -#' rmd2slidy(c("file1", "file2"), inc_word = TRUE) -#' -#' # Create slidy presentations from all Rmd files in your working directory -#' rmd2slidy() -#' } #' @export rmd2slidy <- function(x, zip = if (length(x) == 1 & !add) FALSE else TRUE, pdf = FALSE, zip_pdf = zip, pdf_args = list(), diff --git a/R/rmd2word.R b/R/rmd2word.R index 04b7374..ad50c0c 100644 --- a/R/rmd2word.R +++ b/R/rmd2word.R @@ -68,9 +68,10 @@ #' @details Information such as \code{title}, \code{author}, \code{lang} etc in #' the YAML header in the Rmd file are used but \code{output} is ignored. #' -#' The simplest setup is to have the \code{.Rmd} files and the Word -#' template (if used) and \code{OfficeToPDF.exe} in the current working -#' directory. +#' The simplest setup is to have the \code{.Rmd} files in the current +#' working directory, in which case `rmd2word()` will create Word documents +#' from all these Rmd files, but the \code{.Rmd} files may be in different +#' directories. #' #' It is possible to have the \code{.Rmd} files in different #' directories, but any non-\code{"default"} values in \code{doc} must be @@ -148,22 +149,13 @@ #' got_pandoc <- rmarkdown::pandoc_available("1.14") #' got_all <- got_hux && got_flex && got_pandoc #' # This example needs packages huxtable and flextable +#' # If pdf = TRUE then OfficeToPDF must first be installed using the +#' # function accessr::install_otp #' if (got_all) { #' ex_file <- system.file(package = "accessr", "examples", "example.Rmd") #' ex_file <- sub(".Rmd", "", ex_file) #' rmd2word(ex_file, pdf = FALSE) #' } -#' -#' \dontrun{ -#' # Install OfficeToPDF to create PDF files -#' install_otp() -#' -#' # Create PDF documents files from your files file1.Rmd and file2.Rmd -#' rmd2pdf(c("file1", "file2")) -#' -#' # Create Word and PDF files from all Rmd files in your working directory -#' rmd2word(inc_word = TRUE) -#' } #' @export rmd2word <- function(x, doc = "accessr", pdf = isTRUE(.Platform$OS.type == "windows"), dir, diff --git a/man/install_otp.Rd b/man/install_otp.Rd index 1155983..bcb8079 100644 --- a/man/install_otp.Rd +++ b/man/install_otp.Rd @@ -47,7 +47,6 @@ is forced. documents in \code{\link{rmd2word}}. } \examples{ -\dontrun{ +# If dir is not supplied install_otp stops and dir = "accessr" is suggested install_otp() } -} diff --git a/man/rmd2html.Rd b/man/rmd2html.Rd index c9f988d..d9a8715 100644 --- a/man/rmd2html.Rd +++ b/man/rmd2html.Rd @@ -93,8 +93,9 @@ Information such as \code{title}, \code{author}, \code{lang} etc in the YAML header in the Rmd file are used but \code{output} is ignored. The simplest setup is to have the \code{.Rmd} files in the current -working directory, but it is possible to have the \code{.Rmd} files in -different directories. +working directory, in which case \code{rmd2html()} will create HTML documents +from all these Rmd files, the \code{.Rmd} files may be in different +directories. The \code{\link[rmarkdown]{render}} function, with the argument \code{output_file =} \code{\link[rmarkdown]{html_document}} @@ -112,14 +113,6 @@ if (got_all) { ex_file <- sub(".Rmd", "", ex_file) rmd2html(ex_file) } - -\dontrun{ -# Create HTML documents from your files file1.Rmd and file2.Rmd -rmd2html(c("file1", "file2")) - -# Create HTML documents from all Rmd files in your working directory -rmd2html() -} } \seealso{ \code{\link{rmd2many}}, \code{\link{rmd2word}}, diff --git a/man/rmd2ioslides.Rd b/man/rmd2ioslides.Rd index ce4cd5d..74fbe30 100644 --- a/man/rmd2ioslides.Rd +++ b/man/rmd2ioslides.Rd @@ -111,8 +111,9 @@ Information such as \code{title}, \code{author}, \code{lang} etc in the YAML header in the Rmd file are used but \code{output} is ignored. The simplest setup is to have the \code{.Rmd} files in the current -working directory, but it is possible to have the \code{.Rmd} files in -different directories. +working directory, in which case \code{rmd2ioslides()} will create ioslides +presentations from all these Rmd files, but the \code{.Rmd} files may be +in different directories. The \code{\link[rmarkdown]{render}} function, with the argument \code{output_file =} \code{\link[rmarkdown]{ioslides_presentation}} @@ -164,14 +165,6 @@ if (got_all) { ex_file <- sub(".Rmd", "", ex_file) rmd2ioslides(ex_file) } - -\dontrun{ -# Create ioslides presentations from your files file1.Rmd and file2.Rmd -rmd2ioslides(c("file1", "file2"), inc_word = TRUE) - -# Create ioslides presentations from all Rmd files in your working directory -rmd2ioslides() -} } \seealso{ \code{\link{rmd2many}}, \code{\link{rmd2word}}, diff --git a/man/rmd2many.Rd b/man/rmd2many.Rd index e4efdc3..814e5eb 100644 --- a/man/rmd2many.Rd +++ b/man/rmd2many.Rd @@ -118,11 +118,6 @@ if (got_all) { ex_file <- sub(".Rmd", "", ex_file) rmd2many(ex_file, params = list(hide = TRUE), pdf = FALSE, zip = TRUE) } - -\dontrun{ -# Create multiple documents files from your files file1.Rmd and file2.Rmd -rmd2many(c("file1", "file2")) -} } \seealso{ \code{\link{install_otp}} to install diff --git a/man/rmd2slidy.Rd b/man/rmd2slidy.Rd index 36f73cd..45ae527 100644 --- a/man/rmd2slidy.Rd +++ b/man/rmd2slidy.Rd @@ -109,8 +109,9 @@ Information such as \code{title}, \code{author}, \code{lang} etc in the YAML header in the Rmd file are used but \code{output} is ignored. The simplest setup is to have the \code{.Rmd} files in the current -working directory, but it is possible to have the \code{.Rmd} files in -different directories. +working directory, in which case \code{rmd2slidy()} will create slidy +presentations from all these Rmd files, but the \code{.Rmd} files may be +in different directories. The \code{\link[rmarkdown]{render}} function, with the argument \code{output_file =} \code{\link[rmarkdown]{slidy_presentation}} @@ -128,14 +129,6 @@ if (got_all) { ex_file <- sub(".Rmd", "", ex_file) rmd2slidy(ex_file) } - -\dontrun{ -# Create slidy presentations from your files file1.Rmd and file2.Rmd -rmd2slidy(c("file1", "file2"), inc_word = TRUE) - -# Create slidy presentations from all Rmd files in your working directory -rmd2slidy() -} } \seealso{ \code{\link{rmd2word}}, \code{\link{rmd2word}}, diff --git a/man/rmd2word.Rd b/man/rmd2word.Rd index 52acfe5..e38fe98 100644 --- a/man/rmd2word.Rd +++ b/man/rmd2word.Rd @@ -113,9 +113,10 @@ this software. Zip archives of the Word and/or PDF files may be created. Information such as \code{title}, \code{author}, \code{lang} etc in the YAML header in the Rmd file are used but \code{output} is ignored. -The simplest setup is to have the \code{.Rmd} files and the Word -template (if used) and \code{OfficeToPDF.exe} in the current working -directory. +The simplest setup is to have the \code{.Rmd} files in the current +working directory, in which case \code{rmd2word()} will create Word documents +from all these Rmd files, but the \code{.Rmd} files may be in different +directories. It is possible to have the \code{.Rmd} files in different directories, but any non-\code{"default"} values in \code{doc} must be @@ -174,22 +175,13 @@ 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 pdf = TRUE then OfficeToPDF must first be installed using the +# function accessr::install_otp if (got_all) { ex_file <- system.file(package = "accessr", "examples", "example.Rmd") ex_file <- sub(".Rmd", "", ex_file) rmd2word(ex_file, pdf = FALSE) } - -\dontrun{ -# Install OfficeToPDF to create PDF files -install_otp() - -# Create PDF documents files from your files file1.Rmd and file2.Rmd -rmd2pdf(c("file1", "file2")) - -# Create Word and PDF files from all Rmd files in your working directory -rmd2word(inc_word = TRUE) -} } \references{ Layton, Richard. (2015) Happy collaboration with Rmd to docx.