Skip to content
Snippets Groups Projects
Commit a628eeeb authored by jens.preussner's avatar jens.preussner :ghost:
Browse files

Fixed render in case of interactive dashboard

parent 4c6a7f03
No related branches found
No related tags found
No related merge requests found
Pipeline #114492 failed
......@@ -4,7 +4,7 @@
#' @param pages A string or vector with the names of pages, which should be assembled to a report.
#' @param file The output filename (recommend that the suffix should be '.Rmd'). This file will be saved in the working directory.
#' @param exclude A string or vector with the names of pages, which should be excluded from report assembly.
#' @param render A logical indicating whether the assembled report should immediately be rendered with \code{rmarkdown::render}.
#' @param render A logical indicating whether the assembled report should immediately be rendered with \code{rmarkdown::render} or run with \code{rmarkdown::run}.
#' @param ... Additional arguments passed on to \code{rmarkdown::render}.
#'
#' @rdname i2dashboard-methods
......@@ -70,11 +70,15 @@ setMethod("assemble", "i2dashboard", function(dashboard, pages = names(dashboard
# copy tempfile to final_document
file.copy(from = tmp_document, to = file, overwrite = TRUE)
# Render, if requested
if(render) {
# Render or run app, if requested
if(render & !dashboard@interactive) {
rmarkdown::render(file, ...)
}
if(render & dashboard@interactive) {
rmarkdown::run(file, ...)
}
invisible(dashboard)
})
......
......@@ -33,7 +33,7 @@
\item{exclude}{A string or vector with the names of pages, which should be excluded from report assembly.}
\item{render}{A logical indicating whether the assembled report should immediately be rendered with \code{rmarkdown::render}.}
\item{render}{A logical indicating whether the assembled report should immediately be rendered with \code{rmarkdown::render} or run with \code{rmarkdown::run}.}
\item{...}{Additional arguments passed on to \code{rmarkdown::render}.}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment