Skip to content

Commit 14cdf42

Browse files
committed
pr: rename rmd_data to params for consistency
1 parent 3b0c5d4 commit 14cdf42

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

R/tm_rmarkdown.R

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
#' req(data())
7979
#' within(data(),
8080
#' {
81-
#' rmd_data$n_rows <- n_rows_value
81+
#' params$n_rows <- n_rows_value
8282
#' },
8383
#' n_rows_value = input$n_rows
8484
#' )
@@ -189,7 +189,7 @@ srv_rmarkdown <- function(id, data, rmd_file, allow_download, extra_transform) {
189189
eval_code(
190190
data_q,
191191
sprintf(
192-
"rmd_data <- list(%s)",
192+
"params <- list(%s)",
193193
toString(sprintf("%1$s = %1$s", sapply(names(data_q), as.name)))
194194
)
195195
)
@@ -216,7 +216,7 @@ srv_rmarkdown <- function(id, data, rmd_file, allow_download, extra_transform) {
216216
toc = TRUE,
217217
preserve_yaml = TRUE
218218
),
219-
params = datasets[["rmd_data"]],
219+
params = datasets[["params"]],
220220
envir = new.env(parent = globalenv()),
221221
quiet = TRUE,
222222
runtime = "static"
@@ -234,7 +234,6 @@ srv_rmarkdown <- function(id, data, rmd_file, allow_download, extra_transform) {
234234
validate(
235235
need(inherits(output_path, "character"), "Error rendering RMD file. Please contact the app developer.")
236236
)
237-
print(output_path)
238237
htmltools::includeMarkdown(output_path)
239238
})
240239

@@ -249,7 +248,7 @@ srv_rmarkdown <- function(id, data, rmd_file, allow_download, extra_transform) {
249248
paste(
250249
sep = "\n",
251250
sprintf("## R Markdown contents are generated from file, please download it from the module UI."),
252-
sprintf("# rmarkdown::render(%s, params = rmd_data)", shQuote(basename(rmd_file), type = "cmd"))
251+
sprintf("# rmarkdown::render(%s, params = params)", shQuote(basename(rmd_file), type = "cmd"))
253252
)
254253
)
255254
out_data@verified <- FALSE # manual change verified status as code is being injected

man/tm_rmarkdown.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)