resolving report creating on server by exporting/importing kable/md table. works for now. Not ideal.

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-01-23 08:44:38 +01:00
commit 02dfcf50d6
No known key found for this signature in database
11 changed files with 143 additions and 55 deletions

View file

@ -29,19 +29,23 @@ getfun <- function(x) {
#' @return output file name
#' @export
#'
write_quarto <- function(data, ...) {
write_quarto <- function(data,...) {
# Exports data to temporary location
#
# I assume this is more secure than putting it in the www folder and deleting
# on session end
temp <- tempfile(fileext = ".rds")
readr::write_rds(data, file = temp)
# temp <- base::tempfile(fileext = ".rds")
# readr::write_rds(data, file = here)
readr::write_rds(data, file = "www/web_data.rds")
## Specifying a output path will make the rendering fail
## Ref: https://github.com/quarto-dev/quarto-cli/discussions/4041
## Outputs to the same as the .qmd file
quarto::quarto_render(
execute_params = list(data.file = temp),
execute_params = list(data.file = "web_data.rds"),
# execute_params = list(data.file = temp),
...
)
}