From 6d70c15ec37717dfeb77db2dda81ad309256dbc4 Mon Sep 17 00:00:00 2001 From: Carson Date: Fri, 4 Jun 2021 10:46:10 -0500 Subject: [PATCH 1/2] Close #2159: restore previous shiny theme when run() exits --- R/shiny.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/shiny.R b/R/shiny.R index 20faf41064..5281c6fd8a 100644 --- a/R/shiny.R +++ b/R/shiny.R @@ -141,6 +141,8 @@ run <- function(file = "index.Rmd", dir = dirname(file), default_file = NULL, # the theme wins out if (length(target_file)) { format <- output_format_from_yaml_front_matter(read_utf8(target_file)) + old_theme <- shiny::getCurrentTheme() + on.exit(set_current_theme(old_theme), add = TRUE) set_current_theme(resolve_theme(format$options$theme)) } From 94a77e90b5b1e02a1950fa26f5a9619b96932de7 Mon Sep 17 00:00:00 2001 From: Carson Date: Fri, 4 Jun 2021 11:15:20 -0500 Subject: [PATCH 2/2] update news --- NEWS.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 8582bba28b..ca66b59b7c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,7 +7,9 @@ rmarkdown 2.9 - Fix an issue with `copy_ressource = TRUE` in `html_document_base` where very long HTML documents were truncated during post processing (thanks, @oliviermeslin, #2145). -- When rendering a `runtime: shiny` document, an extra temp folder will be used in the output path. With the extra temp random folder in the path, predictable output file names may be used. (#2137) +- When `run()`-ing a `runtime: shiny` document, an extra temp folder will be used in the output path. With the extra temp random folder in the path, predictable output file names may be used. (#2137) + +- When `run()`-ing a `runtime: shiny` document with a `{bslib}` theme, the global theme value wasn't being restored properly. (#2160) - Floating ToC in `html_document` can now hide headings with unnumbered and unlisted classes (thanks, @atusy, #1993). @@ -15,7 +17,6 @@ rmarkdown 2.9 - `rmarkdown::site_generator()` can hang session waiting for input when the `site` field is not found in the YAML frontmatter of `index.Rmd` (thanks, @kevinushey @mirh, #2043). - rmarkdown 2.8 ================================================================================