From d3fa6a82dca05c95572bb35aa3aae73799b5071b Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 21 Mar 2024 08:54:40 -0400 Subject: [PATCH 1/9] chore: `inst/shiny` -> `inst/examples-shiny` --- R/runapp.R | 2 +- inst/{shiny => examples-shiny}/01_hello/DESCRIPTION | 0 inst/{shiny => examples-shiny}/01_hello/Readme.md | 0 inst/{shiny => examples-shiny}/01_hello/app.R | 0 inst/{shiny => examples-shiny}/02_text/DESCRIPTION | 0 inst/{shiny => examples-shiny}/02_text/Readme.md | 0 inst/{shiny => examples-shiny}/02_text/app.R | 0 inst/{shiny => examples-shiny}/03_reactivity/DESCRIPTION | 0 inst/{shiny => examples-shiny}/03_reactivity/Readme.md | 0 inst/{shiny => examples-shiny}/03_reactivity/app.R | 0 inst/{shiny => examples-shiny}/04_mpg/DESCRIPTION | 0 inst/{shiny => examples-shiny}/04_mpg/Readme.md | 0 inst/{shiny => examples-shiny}/04_mpg/app.R | 0 inst/{shiny => examples-shiny}/05_sliders/DESCRIPTION | 0 inst/{shiny => examples-shiny}/05_sliders/Readme.md | 0 inst/{shiny => examples-shiny}/05_sliders/app.R | 0 inst/{shiny => examples-shiny}/06_tabsets/DESCRIPTION | 0 inst/{shiny => examples-shiny}/06_tabsets/Readme.md | 0 inst/{shiny => examples-shiny}/06_tabsets/app.R | 0 inst/{shiny => examples-shiny}/07_widgets/DESCRIPTION | 0 inst/{shiny => examples-shiny}/07_widgets/Readme.md | 0 inst/{shiny => examples-shiny}/07_widgets/app.R | 0 inst/{shiny => examples-shiny}/08_html/DESCRIPTION | 0 inst/{shiny => examples-shiny}/08_html/Readme.md | 0 inst/{shiny => examples-shiny}/08_html/app.R | 0 inst/{shiny => examples-shiny}/08_html/www/index.html | 0 inst/{shiny => examples-shiny}/09_upload/DESCRIPTION | 0 inst/{shiny => examples-shiny}/09_upload/Readme.md | 0 inst/{shiny => examples-shiny}/09_upload/app.R | 0 inst/{shiny => examples-shiny}/10_download/DESCRIPTION | 0 inst/{shiny => examples-shiny}/10_download/Readme.md | 0 inst/{shiny => examples-shiny}/10_download/app.R | 0 inst/{shiny => examples-shiny}/11_timer/DESCRIPTION | 0 inst/{shiny => examples-shiny}/11_timer/Readme.md | 0 inst/{shiny => examples-shiny}/11_timer/app.R | 0 35 files changed, 1 insertion(+), 1 deletion(-) rename inst/{shiny => examples-shiny}/01_hello/DESCRIPTION (100%) rename inst/{shiny => examples-shiny}/01_hello/Readme.md (100%) rename inst/{shiny => examples-shiny}/01_hello/app.R (100%) rename inst/{shiny => examples-shiny}/02_text/DESCRIPTION (100%) rename inst/{shiny => examples-shiny}/02_text/Readme.md (100%) rename inst/{shiny => examples-shiny}/02_text/app.R (100%) rename inst/{shiny => examples-shiny}/03_reactivity/DESCRIPTION (100%) rename inst/{shiny => examples-shiny}/03_reactivity/Readme.md (100%) rename inst/{shiny => examples-shiny}/03_reactivity/app.R (100%) rename inst/{shiny => examples-shiny}/04_mpg/DESCRIPTION (100%) rename inst/{shiny => examples-shiny}/04_mpg/Readme.md (100%) rename inst/{shiny => examples-shiny}/04_mpg/app.R (100%) rename inst/{shiny => examples-shiny}/05_sliders/DESCRIPTION (100%) rename inst/{shiny => examples-shiny}/05_sliders/Readme.md (100%) rename inst/{shiny => examples-shiny}/05_sliders/app.R (100%) rename inst/{shiny => examples-shiny}/06_tabsets/DESCRIPTION (100%) rename inst/{shiny => examples-shiny}/06_tabsets/Readme.md (100%) rename inst/{shiny => examples-shiny}/06_tabsets/app.R (100%) rename inst/{shiny => examples-shiny}/07_widgets/DESCRIPTION (100%) rename inst/{shiny => examples-shiny}/07_widgets/Readme.md (100%) rename inst/{shiny => examples-shiny}/07_widgets/app.R (100%) rename inst/{shiny => examples-shiny}/08_html/DESCRIPTION (100%) rename inst/{shiny => examples-shiny}/08_html/Readme.md (100%) rename inst/{shiny => examples-shiny}/08_html/app.R (100%) rename inst/{shiny => examples-shiny}/08_html/www/index.html (100%) rename inst/{shiny => examples-shiny}/09_upload/DESCRIPTION (100%) rename inst/{shiny => examples-shiny}/09_upload/Readme.md (100%) rename inst/{shiny => examples-shiny}/09_upload/app.R (100%) rename inst/{shiny => examples-shiny}/10_download/DESCRIPTION (100%) rename inst/{shiny => examples-shiny}/10_download/Readme.md (100%) rename inst/{shiny => examples-shiny}/10_download/app.R (100%) rename inst/{shiny => examples-shiny}/11_timer/DESCRIPTION (100%) rename inst/{shiny => examples-shiny}/11_timer/Readme.md (100%) rename inst/{shiny => examples-shiny}/11_timer/app.R (100%) diff --git a/R/runapp.R b/R/runapp.R index af3103d053..10049dd310 100644 --- a/R/runapp.R +++ b/R/runapp.R @@ -468,7 +468,7 @@ runExample <- function(example=NA, host=getOption('shiny.host', '127.0.0.1'), display.mode=c("auto", "normal", "showcase")) { legacy <- getOption('shiny.legacy.examples', FALSE) - examplesDir <- if (isTRUE(legacy)) 'examples' else 'shiny' + examplesDir <- if (isTRUE(legacy)) 'examples' else 'examples-shiny' examplesDir <- system_file(examplesDir, package='shiny') dir <- resolve(examplesDir, example) if (is.null(dir)) { diff --git a/inst/shiny/01_hello/DESCRIPTION b/inst/examples-shiny/01_hello/DESCRIPTION similarity index 100% rename from inst/shiny/01_hello/DESCRIPTION rename to inst/examples-shiny/01_hello/DESCRIPTION diff --git a/inst/shiny/01_hello/Readme.md b/inst/examples-shiny/01_hello/Readme.md similarity index 100% rename from inst/shiny/01_hello/Readme.md rename to inst/examples-shiny/01_hello/Readme.md diff --git a/inst/shiny/01_hello/app.R b/inst/examples-shiny/01_hello/app.R similarity index 100% rename from inst/shiny/01_hello/app.R rename to inst/examples-shiny/01_hello/app.R diff --git a/inst/shiny/02_text/DESCRIPTION b/inst/examples-shiny/02_text/DESCRIPTION similarity index 100% rename from inst/shiny/02_text/DESCRIPTION rename to inst/examples-shiny/02_text/DESCRIPTION diff --git a/inst/shiny/02_text/Readme.md b/inst/examples-shiny/02_text/Readme.md similarity index 100% rename from inst/shiny/02_text/Readme.md rename to inst/examples-shiny/02_text/Readme.md diff --git a/inst/shiny/02_text/app.R b/inst/examples-shiny/02_text/app.R similarity index 100% rename from inst/shiny/02_text/app.R rename to inst/examples-shiny/02_text/app.R diff --git a/inst/shiny/03_reactivity/DESCRIPTION b/inst/examples-shiny/03_reactivity/DESCRIPTION similarity index 100% rename from inst/shiny/03_reactivity/DESCRIPTION rename to inst/examples-shiny/03_reactivity/DESCRIPTION diff --git a/inst/shiny/03_reactivity/Readme.md b/inst/examples-shiny/03_reactivity/Readme.md similarity index 100% rename from inst/shiny/03_reactivity/Readme.md rename to inst/examples-shiny/03_reactivity/Readme.md diff --git a/inst/shiny/03_reactivity/app.R b/inst/examples-shiny/03_reactivity/app.R similarity index 100% rename from inst/shiny/03_reactivity/app.R rename to inst/examples-shiny/03_reactivity/app.R diff --git a/inst/shiny/04_mpg/DESCRIPTION b/inst/examples-shiny/04_mpg/DESCRIPTION similarity index 100% rename from inst/shiny/04_mpg/DESCRIPTION rename to inst/examples-shiny/04_mpg/DESCRIPTION diff --git a/inst/shiny/04_mpg/Readme.md b/inst/examples-shiny/04_mpg/Readme.md similarity index 100% rename from inst/shiny/04_mpg/Readme.md rename to inst/examples-shiny/04_mpg/Readme.md diff --git a/inst/shiny/04_mpg/app.R b/inst/examples-shiny/04_mpg/app.R similarity index 100% rename from inst/shiny/04_mpg/app.R rename to inst/examples-shiny/04_mpg/app.R diff --git a/inst/shiny/05_sliders/DESCRIPTION b/inst/examples-shiny/05_sliders/DESCRIPTION similarity index 100% rename from inst/shiny/05_sliders/DESCRIPTION rename to inst/examples-shiny/05_sliders/DESCRIPTION diff --git a/inst/shiny/05_sliders/Readme.md b/inst/examples-shiny/05_sliders/Readme.md similarity index 100% rename from inst/shiny/05_sliders/Readme.md rename to inst/examples-shiny/05_sliders/Readme.md diff --git a/inst/shiny/05_sliders/app.R b/inst/examples-shiny/05_sliders/app.R similarity index 100% rename from inst/shiny/05_sliders/app.R rename to inst/examples-shiny/05_sliders/app.R diff --git a/inst/shiny/06_tabsets/DESCRIPTION b/inst/examples-shiny/06_tabsets/DESCRIPTION similarity index 100% rename from inst/shiny/06_tabsets/DESCRIPTION rename to inst/examples-shiny/06_tabsets/DESCRIPTION diff --git a/inst/shiny/06_tabsets/Readme.md b/inst/examples-shiny/06_tabsets/Readme.md similarity index 100% rename from inst/shiny/06_tabsets/Readme.md rename to inst/examples-shiny/06_tabsets/Readme.md diff --git a/inst/shiny/06_tabsets/app.R b/inst/examples-shiny/06_tabsets/app.R similarity index 100% rename from inst/shiny/06_tabsets/app.R rename to inst/examples-shiny/06_tabsets/app.R diff --git a/inst/shiny/07_widgets/DESCRIPTION b/inst/examples-shiny/07_widgets/DESCRIPTION similarity index 100% rename from inst/shiny/07_widgets/DESCRIPTION rename to inst/examples-shiny/07_widgets/DESCRIPTION diff --git a/inst/shiny/07_widgets/Readme.md b/inst/examples-shiny/07_widgets/Readme.md similarity index 100% rename from inst/shiny/07_widgets/Readme.md rename to inst/examples-shiny/07_widgets/Readme.md diff --git a/inst/shiny/07_widgets/app.R b/inst/examples-shiny/07_widgets/app.R similarity index 100% rename from inst/shiny/07_widgets/app.R rename to inst/examples-shiny/07_widgets/app.R diff --git a/inst/shiny/08_html/DESCRIPTION b/inst/examples-shiny/08_html/DESCRIPTION similarity index 100% rename from inst/shiny/08_html/DESCRIPTION rename to inst/examples-shiny/08_html/DESCRIPTION diff --git a/inst/shiny/08_html/Readme.md b/inst/examples-shiny/08_html/Readme.md similarity index 100% rename from inst/shiny/08_html/Readme.md rename to inst/examples-shiny/08_html/Readme.md diff --git a/inst/shiny/08_html/app.R b/inst/examples-shiny/08_html/app.R similarity index 100% rename from inst/shiny/08_html/app.R rename to inst/examples-shiny/08_html/app.R diff --git a/inst/shiny/08_html/www/index.html b/inst/examples-shiny/08_html/www/index.html similarity index 100% rename from inst/shiny/08_html/www/index.html rename to inst/examples-shiny/08_html/www/index.html diff --git a/inst/shiny/09_upload/DESCRIPTION b/inst/examples-shiny/09_upload/DESCRIPTION similarity index 100% rename from inst/shiny/09_upload/DESCRIPTION rename to inst/examples-shiny/09_upload/DESCRIPTION diff --git a/inst/shiny/09_upload/Readme.md b/inst/examples-shiny/09_upload/Readme.md similarity index 100% rename from inst/shiny/09_upload/Readme.md rename to inst/examples-shiny/09_upload/Readme.md diff --git a/inst/shiny/09_upload/app.R b/inst/examples-shiny/09_upload/app.R similarity index 100% rename from inst/shiny/09_upload/app.R rename to inst/examples-shiny/09_upload/app.R diff --git a/inst/shiny/10_download/DESCRIPTION b/inst/examples-shiny/10_download/DESCRIPTION similarity index 100% rename from inst/shiny/10_download/DESCRIPTION rename to inst/examples-shiny/10_download/DESCRIPTION diff --git a/inst/shiny/10_download/Readme.md b/inst/examples-shiny/10_download/Readme.md similarity index 100% rename from inst/shiny/10_download/Readme.md rename to inst/examples-shiny/10_download/Readme.md diff --git a/inst/shiny/10_download/app.R b/inst/examples-shiny/10_download/app.R similarity index 100% rename from inst/shiny/10_download/app.R rename to inst/examples-shiny/10_download/app.R diff --git a/inst/shiny/11_timer/DESCRIPTION b/inst/examples-shiny/11_timer/DESCRIPTION similarity index 100% rename from inst/shiny/11_timer/DESCRIPTION rename to inst/examples-shiny/11_timer/DESCRIPTION diff --git a/inst/shiny/11_timer/Readme.md b/inst/examples-shiny/11_timer/Readme.md similarity index 100% rename from inst/shiny/11_timer/Readme.md rename to inst/examples-shiny/11_timer/Readme.md diff --git a/inst/shiny/11_timer/app.R b/inst/examples-shiny/11_timer/app.R similarity index 100% rename from inst/shiny/11_timer/app.R rename to inst/examples-shiny/11_timer/app.R From 20d111b7daa69d0aa1e6dd4233f69e295a620351 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 21 Mar 2024 09:28:34 -0400 Subject: [PATCH 2/9] feat(runExamples): Find examples in any package --- R/runapp.R | 30 +++++++++++++++++++++++------- man/runExample.Rd | 14 +++++++++++++- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/R/runapp.R b/R/runapp.R index 10049dd310..6575667625 100644 --- a/R/runapp.R +++ b/R/runapp.R @@ -447,6 +447,16 @@ stopApp <- function(returnValue = invisible()) { #' @param display.mode The mode in which to display the example. Defaults to #' `showcase`, but may be set to `normal` to see the example without #' code or commentary. +#' @param package The package in which to find the example (defaults to +#' `"shiny"`). +#' +#' To provide examples in your package, store examples in the +#' `inst/examples-shiny` directory of your package. Each example should be +#' in its own subdirectory and should be runnable when [runDir()] is called +#' on the subdirectory. Example apps can include a `DESCRIPTION` file and a +#' `README.md` file to provide metadata and commentary about the example. See +#' the article on [Display Modes](https://shiny.posit.co/r/articles/build/display-modes/) +#' on the Shiny website for more information. #' @inheritParams runApp #' #' @examples @@ -462,14 +472,20 @@ stopApp <- function(returnValue = invisible()) { #' system.file("examples", package="shiny") #' } #' @export -runExample <- function(example=NA, - port=getOption("shiny.port"), - launch.browser = getOption('shiny.launch.browser', interactive()), - host=getOption('shiny.host', '127.0.0.1'), - display.mode=c("auto", "normal", "showcase")) { +runExample <- function( + example = NA, + port = getOption("shiny.port"), + launch.browser = getOption("shiny.launch.browser", interactive()), + host = getOption("shiny.host", "127.0.0.1"), + display.mode = c("auto", "normal", "showcase"), + package = "shiny" +) { legacy <- getOption('shiny.legacy.examples', FALSE) - examplesDir <- if (isTRUE(legacy)) 'examples' else 'examples-shiny' - examplesDir <- system_file(examplesDir, package='shiny') + examplesDir <- "examples-shiny" + if (identical(package, "shiny") && isTRUE(legacy)) { + examplesDir <- "examples" + } + examplesDir <- system_file(examplesDir, package = package) dir <- resolve(examplesDir, example) if (is.null(dir)) { if (is.na(example)) { diff --git a/man/runExample.Rd b/man/runExample.Rd index c17a40ba56..a8dd2d8959 100644 --- a/man/runExample.Rd +++ b/man/runExample.Rd @@ -9,7 +9,8 @@ runExample( port = getOption("shiny.port"), launch.browser = getOption("shiny.launch.browser", interactive()), host = getOption("shiny.host", "127.0.0.1"), - display.mode = c("auto", "normal", "showcase") + display.mode = c("auto", "normal", "showcase"), + package = "shiny" ) } \arguments{ @@ -34,6 +35,17 @@ to the \code{shiny.host} option, if set, or \code{"127.0.0.1"} if not.} \item{display.mode}{The mode in which to display the example. Defaults to \code{showcase}, but may be set to \code{normal} to see the example without code or commentary.} + +\item{package}{The package in which to find the example (defaults to +\code{"shiny"}). + +To provide examples in your package, store examples in the +\code{inst/examples-shiny} directory of your package. Each example should be +in its own subdirectory and should be runnable when \code{\link[=runDir]{runDir()}} is called +on the subdirectory. Example apps can include a \code{DESCRIPTION} file and a +\code{README.md} file to provide metadata and commentary about the example. See +the article on \href{https://shiny.posit.co/r/articles/build/display-modes/}{Display Modes} +on the Shiny website for more information.} } \description{ Launch Shiny example applications, and optionally, your system's web browser. From cc31c7df18053533555135fad87e70ff68440765 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 21 Mar 2024 09:37:42 -0400 Subject: [PATCH 3/9] refactor: code style --- R/runapp.R | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/R/runapp.R b/R/runapp.R index 6575667625..1fa226a054 100644 --- a/R/runapp.R +++ b/R/runapp.R @@ -480,12 +480,14 @@ runExample <- function( display.mode = c("auto", "normal", "showcase"), package = "shiny" ) { - legacy <- getOption('shiny.legacy.examples', FALSE) - examplesDir <- "examples-shiny" - if (identical(package, "shiny") && isTRUE(legacy)) { - examplesDir <- "examples" - } - examplesDir <- system_file(examplesDir, package = package) + use_legacy_shiny_examples <- + identical(package, "shiny") && + isTRUE(getOption('shiny.legacy.examples', FALSE)) + + examplesDir <- system_file( + if (use_legacy_shiny_examples) "examples" else "examples-shiny", + package = package + ) dir <- resolve(examplesDir, example) if (is.null(dir)) { if (is.na(example)) { From 0b373a825b05609906d3e5cae844a46a2fc8ab97 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 21 Mar 2024 09:40:57 -0400 Subject: [PATCH 4/9] refactor: small code style changes --- R/runapp.R | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/R/runapp.R b/R/runapp.R index 1fa226a054..b920436be5 100644 --- a/R/runapp.R +++ b/R/runapp.R @@ -488,26 +488,25 @@ runExample <- function( if (use_legacy_shiny_examples) "examples" else "examples-shiny", package = package ) + dir <- resolve(examplesDir, example) + if (is.null(dir)) { + valid_examples <- sprintf( + 'Valid examples are "%s"', + paste(list.files(examplesDir), collapse = '", "') + ) + if (is.na(example)) { - errFun <- message - errMsg <- '' - } - else { - errFun <- stop - errMsg <- paste('Example', example, 'does not exist. ') + message(valid_examples) + return(invisible()) } - errFun(errMsg, - 'Valid examples are "', - paste(list.files(examplesDir), collapse='", "'), - '"') - } - else { - runApp(dir, port = port, host = host, launch.browser = launch.browser, - display.mode = display.mode) + stop("Example '", example, "' does not exist. ", valid_examples) } + + runApp(dir, port = port, host = host, launch.browser = launch.browser, + display.mode = display.mode) } #' Run a gadget From 971f5f62cb1364874dea90994ca6afbdecbf66e9 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 21 Mar 2024 09:43:12 -0400 Subject: [PATCH 5/9] docs: fix runApp typo --- R/runapp.R | 2 +- man/runExample.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/runapp.R b/R/runapp.R index b920436be5..5a76a7af51 100644 --- a/R/runapp.R +++ b/R/runapp.R @@ -452,7 +452,7 @@ stopApp <- function(returnValue = invisible()) { #' #' To provide examples in your package, store examples in the #' `inst/examples-shiny` directory of your package. Each example should be -#' in its own subdirectory and should be runnable when [runDir()] is called +#' in its own subdirectory and should be runnable when [runApp()] is called #' on the subdirectory. Example apps can include a `DESCRIPTION` file and a #' `README.md` file to provide metadata and commentary about the example. See #' the article on [Display Modes](https://shiny.posit.co/r/articles/build/display-modes/) diff --git a/man/runExample.Rd b/man/runExample.Rd index a8dd2d8959..56c3937459 100644 --- a/man/runExample.Rd +++ b/man/runExample.Rd @@ -41,7 +41,7 @@ code or commentary.} To provide examples in your package, store examples in the \code{inst/examples-shiny} directory of your package. Each example should be -in its own subdirectory and should be runnable when \code{\link[=runDir]{runDir()}} is called +in its own subdirectory and should be runnable when \code{\link[=runApp]{runApp()}} is called on the subdirectory. Example apps can include a \code{DESCRIPTION} file and a \code{README.md} file to provide metadata and commentary about the example. See the article on \href{https://shiny.posit.co/r/articles/build/display-modes/}{Display Modes} From b7859d7ac1db56d31ee9fa7a44d88ac3feddfd5c Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 21 Mar 2024 10:39:10 -0400 Subject: [PATCH 6/9] chore: include package name in valid examples message --- R/runapp.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/runapp.R b/R/runapp.R index 5a76a7af51..693905a785 100644 --- a/R/runapp.R +++ b/R/runapp.R @@ -493,7 +493,8 @@ runExample <- function( if (is.null(dir)) { valid_examples <- sprintf( - 'Valid examples are "%s"', + 'Valid examples in %s: "%s"', + package, paste(list.files(examplesDir), collapse = '", "') ) From 3d0930dcf2069f12bc708f5e66b757beaef59617 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 21 Mar 2024 10:42:18 -0400 Subject: [PATCH 7/9] chore(runExample): check that `package` is installed --- R/runapp.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/runapp.R b/R/runapp.R index 693905a785..bf8383cb09 100644 --- a/R/runapp.R +++ b/R/runapp.R @@ -480,6 +480,10 @@ runExample <- function( display.mode = c("auto", "normal", "showcase"), package = "shiny" ) { + if (!identical(package, "shiny") && !is_installed(package)) { + rlang::check_installed(package) + } + use_legacy_shiny_examples <- identical(package, "shiny") && isTRUE(getOption('shiny.legacy.examples', FALSE)) From 2c9b5e049a41b5ce3eb2b0feb6e76eb11b19c2da Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 21 Mar 2024 10:44:44 -0400 Subject: [PATCH 8/9] chore: use braced package name --- R/runapp.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/runapp.R b/R/runapp.R index bf8383cb09..c6af84a2a1 100644 --- a/R/runapp.R +++ b/R/runapp.R @@ -497,7 +497,7 @@ runExample <- function( if (is.null(dir)) { valid_examples <- sprintf( - 'Valid examples in %s: "%s"', + 'Valid examples in {%s}: "%s"', package, paste(list.files(examplesDir), collapse = '", "') ) From 5e01f3dc33032b68c7379018c7b6174f62312634 Mon Sep 17 00:00:00 2001 From: Carson Date: Thu, 21 Mar 2024 11:29:34 -0500 Subject: [PATCH 9/9] Update news --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index b074017cf5..ca461d1f0d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -16,6 +16,8 @@ * Added `onUnhandledError()` to register a function that will be called when an unhandled error occurs in a Shiny app. Note that this handler doesn't stop the error or prevent the session from closing, but it can be used to log the error or to clean up session-specific resources. (thanks @JohnCoene, #3993) +* `runExamples()` now uses the `{bslib}` package to build the user interface (UI). It also gains a `package` argument so that other packages can leverage this same function to run Shiny app examples. For more, see `?runExamples`. (#3963, #4005) + ## Bug fixes * Notifications are now constrained to the width of the viewport for window widths smaller the default notification panel size. (#3949)