-
-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
What is your question?
Based on the readme I tried the following steps:
- Installed the
roxy.shinylive - Edited the
DESCRIPTIONfile withroxygen: list(markdown = TRUE, packages = c("roxy.shinylive")) - In one of the examples (example_module), I included the
@examplesShinylivetag. Of course I had to run the docs via a static server to make it work so I did that usingI see that this is just an iframe embed so there is no need to serve it.httpuv::runStaticServer(dir = "/Users/vedha/insightsengineering/teal/docs/"). Would be nice to mention this in the docs so people don't get confused when they don't see this working when opening the static HTML file like they're used to.
This had a few small issues with how the examples were written and to make it work I had to make sure that:
- The
library(teal)was called in the example. Should we have a hook to call the package before running any example? - Since the
shinyApp()was run inside theif (interactive())it did not work unless I changed the if condition to something like thisinteractive() || !is.null(getOption('webr_pkg_repos'))(not recommending this, I was just testing) - The iframe width of
140%seems to overlap and cause layout issues for me. I don't understand why we have this. - It would be nice if we display the shinylive app below the example code.
The final example roxygen code looked like this in my case:
#' @inheritParams teal_modules
#' @return A `teal` module which can be included in the `modules` argument to [init()].
#' @examplesShinylive
#' @examples
#'
#' library(teal)
#' app <- init(
#' data = teal_data(IRIS = iris, MTCARS = mtcars),
#' modules = example_module()
#' )
#' if (interactive() || !is.null(getOption('webr_pkg_repos'))) {
#' shinyApp(app$ui, app$server)
#' }
#' @exportSo, I'm looking for a better way to write examples, or add supporting hooks to make it easier to use this package.
Code of Conduct
- I agree to follow this project's Code of Conduct.
Contribution Guidelines
- I agree to follow this project's Contribution Guidelines.
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested