diff --git a/pkgdown.yml b/pkgdown.yml
index 3cb4731..9b59c1a 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -2,7 +2,7 @@ pandoc: 3.1.11
pkgdown: 2.0.8
pkgdown_sha: ~
articles: {}
-last_built: 2024-04-17T19:11Z
+last_built: 2024-04-17T19:19Z
urls:
reference: https://posit-dev.github.io/r-shinylive/reference
article: https://posit-dev.github.io/r-shinylive/articles
diff --git a/search.json b/search.json
index bbcf771..ab3e5ee 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"https://posit-dev.github.io/r-shinylive/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 shinylive authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Barret Schloerke. Author, maintainer. Winston Chang. Author. George Stagg. Contributor. . Copyright holder, funder.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Schloerke B, Chang W (2024). shinylive: Run 'shiny' Applications Browser. R package version 0.1.1.9000, https://github.com/posit-dev/r-shinylive, https://posit-dev.github.io/r-shinylive/.","code":"@Manual{, title = {shinylive: Run 'shiny' Applications in the Browser}, author = {Barret Schloerke and Winston Chang}, year = {2024}, note = {R package version 0.1.1.9000, https://github.com/posit-dev/r-shinylive}, url = {https://posit-dev.github.io/r-shinylive/}, }"},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"shinylive","dir":"","previous_headings":"","what":"Run shiny Applications in the Browser","title":"Run shiny Applications in the Browser","text":"repository contains R package exporting Shiny applications Shinylive applications. repository https://github.com/posit-dev/shinylive repository. repository used generate Shinylive assets distribution, bundle containing HTML, JavaScript, CSS, wasm files. R package repository downloads assets uses create Shinylive applications. Twin shinylive python package: https://github.com/posit-dev/py-shinylive","code":""},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Run shiny Applications in the Browser","text":"can install released version shinylive CRAN via: can install development version shinylive GitHub via:","code":"install.packages(\"shinylive\") # install.packages(\"pak\") pak::pak(\"posit-dev/r-shinylive\")"},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Run shiny Applications in the Browser","text":"(Optional) Create basic shiny application new directory myapp/: Shiny application myapp/ like turn Shinylive app site/: can preview application running web server visiting browser: point, can deploy site/ directory static web hosting service.","code":"# Copy \"Hello World\" from `{shiny}` system.file(\"examples\", \"01_hello\", package=\"shiny\") |> fs::dir_copy(\"myapp\", overwrite = TRUE) shinylive::export(\"myapp\", \"site\") httpuv::runStaticServer(\"site/\")"},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"multiple-applications","dir":"","previous_headings":"Usage","what":"Multiple applications","title":"Run shiny Applications in the Browser","text":"multiple applications want put site, can export subdirectories site, can share Shinylive assets. can --subdir option:","code":"shinylive::export(\"myapp1\", \"site\", subdir = \"app1\") shinylive::export(\"myapp2\", \"site\", subdir = \"app2\")"},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"github-pages","dir":"","previous_headings":"Usage","what":"GitHub Pages","title":"Run shiny Applications in the Browser","text":"posit-dev/r-shiny workflow automatically deploy Shiny app root directory GitHub repository GitHub Pages. add workflow repository, call usethis::use_github_action(url=\"https://github.com/posit-dev/r-shinylive/blob/actions/v1/examples/deploy-app.yaml\"). information, see examples folder.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"r-package-availability","dir":"","previous_headings":"","what":"R package availability","title":"Run shiny Applications in the Browser","text":"shinylive web assets statically inspect packages used via renv. need package can found renv, add impossible--reach code within Shiny application library call R package. example: ’d rather handle manually, call webr::install(\"CRAN_PKG\") Shiny application calling library(CRAN_PKG) require(\"CRAN_PKG\"). R package trouble loading, visit https://repo.r-wasm.org/ see able installed precompiled WebAssembly binary. Note {webr}: possible install packages source webR. likely change near future, process require entire C Fortran compiler toolchain run inside browser. moment, providing pre-compiled WebAssembly binaries supported way install R packages webR.","code":"if (FALSE) { library(HIDDEN_CRAN_PKG) }"},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"shinylive-asset-management","dir":"","previous_headings":"","what":"Shinylive asset management","title":"Run shiny Applications in the Browser","text":"version Shinylive R package associated particular version Shinylive web assets. (See releases .) see version R package , version web assets associated , simply run shinylive::assets_info() R session. also show asset versions already installed locally: web assets downloaded cached first time run shinylive::export(). , can run shinylive::assets_download() fetch manually. can remove old versions shinylive::assets_cleanup(). remove versions except one Python package wants use: remove specific version, use shinylive::assets_remove():","code":"shinylive::assets_info() #> shinylive R package version: 0.1.0 #> shinylive web assets version: 0.2.1 #> #> Local cached shinylive asset dir: #> /Users/username/Library/Caches/shinylive #> #> Installed assets: #> /Users/username/Library/Caches/shinylive/0.2.1 #> /Users/username/Library/Caches/shinylive/0.2.0 shinylive::assets_download(\"0.1.5\") #> Downloading shinylive v0.1.5... #> Unzipping to /Users/username/Library/Caches/shinylive/ shinylive::assets_cleanup() #> Keeping version 0.2.1 #> Removing /Users/username/Library/Caches/shinylive/0.2.0 #> Removing /Users/username/Library/Caches/shinylive/0.1.5 shinylive::assets_remove(\"0.2.1\") #> Removing /Users/username/Library/Caches/shinylive/0.2.1"},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"known-limitations","dir":"","previous_headings":"","what":"Known limitations","title":"Run shiny Applications in the Browser","text":"possible install packages source webR. likely change near future, process require entire C Fortran compiler toolchain run inside browser. moment, providing pre-compiled WebAssembly binaries supported way install R packages webR.","code":""},{"path":[]},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"setup---shinylive-assets","dir":"","previous_headings":"Development","what":"Setup - shinylive assets","title":"Run shiny Applications in the Browser","text":"Works latest GitHub version posit-dev/shinylive (>= v0.2.1). linking shinylive assets asset cache folder, must first build shiny live assets: link assets (using shinylive R package) asset cache folder changes assets automatically cached shinylive assets:","code":"## In your shinylive assets repo # cd PATH/TO/posit-dev/shinylive # Generate the shiny live assets make submodules all # Link to your local shinylive repo shinylive::assets_install_link(\"PATH/TO/posit-dev/shinylive\")"},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"setup---quarto","dir":"","previous_headings":"Development","what":"Setup - quarto","title":"Run shiny Applications in the Browser","text":"quarto project, call following lines terminal install updated shinylive quarto extension: default, extension used installed shinylive R package. use local shinylive R package, run following R session update quarto extension locally:","code":"# Go to the quarto project directory cd local/quarto # Install the updated shinylive quarto extension quarto add quarto-ext/shinylive if (!require(\"pkgload\")) install.packages(\"pkgload\") shinylive_lua <- file.path(\"local\", \"quarto\", \"_extensions\", \"quarto-ext\", \"shinylive\", \"shinylive.lua\") shinylive_lua |> brio::read_file() |> sub( pattern = \"shinylive::quarto_ext()\", replacement = \"pkgload::load_all('../../', quiet = TRUE); shinylive::quarto_ext()\", fixed = TRUE ) |> brio::write_file(shinylive_lua)"},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"execute---export","dir":"","previous_headings":"Development","what":"Execute - export()","title":"Run shiny Applications in the Browser","text":"Export local app directory run :","code":"library(httpuv) # >= 1.6.12 pkgload::load_all() # Delete prior unlink(\"local/shiny-apps-out/\", recursive = TRUE) export(\"local/shiny-apps/simple-r\", \"local/shiny-apps-out\") # Host the local directory httpuv::runStaticServer(\"local/shiny-apps-out/\")"},{"path":"https://posit-dev.github.io/r-shinylive/reference/assets.html","id":null,"dir":"Reference","previous_headings":"","what":"Manage shinylive assets — assets_download","title":"Manage shinylive assets — assets_download","text":"Helper methods managing shinylive assets.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/assets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Manage shinylive assets — assets_download","text":"","code":"assets_download( version = assets_version(), ..., dir = assets_cache_dir(), url = assets_bundle_url(version) ) assets_ensure( version = assets_version(), ..., dir = assets_cache_dir(), url = assets_bundle_url(version) ) assets_cleanup(..., dir = assets_cache_dir()) assets_remove(versions, ..., dir = assets_cache_dir()) assets_info() assets_version()"},{"path":"https://posit-dev.github.io/r-shinylive/reference/assets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Manage shinylive assets — assets_download","text":"version version assets download. ... Ignored. dir asset cache directory. Unless testing, default behavior used. url URL download assets . Unless testing, default behavior used. versions assets versions remove.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/assets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Manage shinylive assets — assets_download","text":"assets_version() returns version currently supported Shinylive. methods return invisible().","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/assets.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Manage shinylive assets — assets_download","text":"assets_download(): Downloads shinylive assets bundle GitHub extracts specified directory. bundle always downloaded GitHub, even already exists cache directory (dir=). assets_ensure(): Ensures local copy shinylive installed. local copy shinylive installed, downloaded installed. local copy shinylive installed, path returned. assets_cleanup(): Removes local copies shinylive web assets, except one used current version shinylive. assets_remove(): Removes local copies shinylive web assets. assets_info(): Prints information local shinylive assets installed. assets_version(): Returns version currently supported Shinylive assets version.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/export.html","id":null,"dir":"Reference","previous_headings":"","what":"Export a Shiny app to a directory — export","title":"Export a Shiny app to a directory — export","text":"function exports Shiny app directory, can served using httpuv.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/export.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export a Shiny app to a directory — export","text":"","code":"export(appdir, destdir, ..., subdir = \"\", verbose = is_interactive())"},{"path":"https://posit-dev.github.io/r-shinylive/reference/export.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export a Shiny app to a directory — export","text":"appdir Directory containing application. destdir Destination directory. ... Ignored subdir Subdirectory destdir write app . verbose Print verbose output. Defaults TRUE running interactively.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/export.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export a Shiny app to a directory — export","text":"Nothing. app exported destdir. Instructions serving directory printed stdout.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/export.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export a Shiny app to a directory — export","text":"","code":"if (FALSE) { # interactive() app_dir <- system.file(\"examples\", \"01_hello\", package = \"shiny\") out_dir <- tempfile(\"shinylive-export\") # Export the app to a directory export(app_dir, out_dir) # Serve the exported directory if (require(httpuv)) { httpuv::runStaticServer(out_dir) } }"},{"path":"https://posit-dev.github.io/r-shinylive/reference/install.html","id":null,"dir":"Reference","previous_headings":"","what":"Install shinylive assets from from a local directory — assets_install_copy","title":"Install shinylive assets from from a local directory — assets_install_copy","text":"Helper methods testing updates shinylive assets.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/install.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Install shinylive assets from from a local directory — assets_install_copy","text":"","code":"assets_install_copy( assets_repo_dir, ..., dir = assets_cache_dir(), version = package_json_version(assets_repo_dir) ) assets_install_link( assets_repo_dir, ..., dir = assets_cache_dir(), version = package_json_version(assets_repo_dir) )"},{"path":"https://posit-dev.github.io/r-shinylive/reference/install.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Install shinylive assets from from a local directory — assets_install_copy","text":"assets_repo_dir local repository directory shinylive assets (e.g. posit-dev/shinylive) ... Ignored. dir asset cache directory. Unless testing, default behavior used. version version assets installed.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/install.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Install shinylive assets from from a local directory — assets_install_copy","text":"method return invisible().","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/install.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Install shinylive assets from from a local directory — assets_install_copy","text":"assets_install_copy(): Copies shinylive assets local shinylive repository (e.g. posit-dev/shinylive). must repeated change assets. assets_install_link(): Creates symlink local shinylive assets cached assets directory. first installation, assets source due symlink.","code":""},{"path":[]},{"path":"https://posit-dev.github.io/r-shinylive/reference/quarto_ext.html","id":null,"dir":"Reference","previous_headings":"","what":"Quarto extension for shinylive — quarto_ext","title":"Quarto extension for shinylive — quarto_ext","text":"Integration https://github.com/quarto-ext/shinylive","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/quarto_ext.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Quarto extension for shinylive — quarto_ext","text":"","code":"quarto_ext( args = commandArgs(trailingOnly = TRUE), ..., pretty = is_interactive() )"},{"path":"https://posit-dev.github.io/r-shinylive/reference/quarto_ext.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Quarto extension for shinylive — quarto_ext","text":"args Command line arguments passed extension. See details information. ... Ignored. pretty Whether pretty print JSON output.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/quarto_ext.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Quarto extension for shinylive — quarto_ext","text":"Nothing. Values printed stdout.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/quarto_ext.html","id":"command-arguments","dir":"Reference","previous_headings":"","what":"Command arguments","title":"Quarto extension for shinylive — quarto_ext","text":"first argument must \"extension\". done match py-shinylive can nest sub-commands extension argument minimize api clutter user can see.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/quarto_ext.html","id":"cli-interface","dir":"Reference","previous_headings":"","what":"CLI Interface","title":"Quarto extension for shinylive — quarto_ext","text":"extension info Prints information extension including: version: version R package assets_version: version web assets scripts: list paths scripts used extension, mainly codeblock--json Example extension base-htmldeps Prints language agnostic quarto html dependencies JSON array. first html dependency shinylive service workers. second html dependency shinylive base dependencies. dependency contain core shinylive asset scripts (JS files automatically sourced), stylesheets (CSS files automatically included), resources (additional files JS CSS files can source). Example extension language-resources Prints language-specific resource files JSON added quarto html dependency. r-shinylive, includes webr resource files py-shinylive, includes pyodide pyright resource files. Example extension app-resources Prints app-specific resource files JSON added \"shinylive\" quarto html dependency. Currently, r-shinylive return resource files. Example","code":"{ \"version\": \"0.1.0\", \"assets_version\": \"0.2.0\", \"scripts\": { \"codeblock-to-json\": \"/
/shinylive-0.2.0/scripts/codeblock-to-json.js\" } } [ { \"name\": \"shinylive-serviceworker\", \"version\": \"0.2.0\", \"meta\": { \"shinylive:serviceworker_dir\": \".\" }, \"serviceworkers\": [ { \"source\": \"//shinylive-0.2.0/shinylive-sw.js\", \"destination\": \"/shinylive-sw.js\" } ] }, { \"name\": \"shinylive\", \"version\": \"0.2.0\", \"scripts\": [{ \"name\": \"shinylive/load-shinylive-sw.js\", \"path\": \"//shinylive-0.2.0/shinylive/load-shinylive-sw.js\", \"attribs\": { \"type\": \"module\" } }], \"stylesheets\": [{ \"name\": \"shinylive/shinylive.css\", \"path\": \"//shinylive-0.2.0/shinylive/shinylive.css\" }], \"resources\": [ { \"name\": \"shinylive/shinylive.js\", \"path\": \"//shinylive-0.2.0/shinylive/shinylive.js\" }, ... # [ truncated ] ] } ] [ { \"name\": \"shinylive/webr/esbuild.d.ts\", \"path\": \"//shinylive-0.2.0/shinylive/webr/esbuild.d.ts\" }, { \"name\": \"shinylive/webr/libRblas.so\", \"path\": \"//shinylive-0.2.0/shinylive/webr/libRblas.so\" }, ... # [ truncated ] ] [ { \"name\": \"shinylive/pyodide/anyio-3.7.0-py3-none-any.whl\", \"path\": \"//shinylive-0.2.0/shinylive/pyodide/anyio-3.7.0-py3-none-any.whl\" }, { \"name\": \"shinylive/pyodide/appdirs-1.4.4-py2.py3-none-any.whl\", \"path\": \"//shinylive-0.2.0/shinylive/pyodide/appdirs-1.4.4-py2.py3-none-any.whl\" }, ... # [ truncated ] ]"},{"path":[]},{"path":"https://posit-dev.github.io/r-shinylive/news/index.html","id":"shinylive-011","dir":"Changelog","previous_headings":"","what":"shinylive 0.1.1","title":"shinylive 0.1.1","text":"CRAN release: 2023-12-04 Bump shinylive assets dependency 0.2.3. (#38) Use httpuv serve static folder instead plumber. (#40) Use httr2 download assets GitHub releases. (@dgkf #30, #39)","code":""},{"path":"https://posit-dev.github.io/r-shinylive/news/index.html","id":"shinylive-010","dir":"Changelog","previous_headings":"","what":"shinylive 0.1.0","title":"shinylive 0.1.0","text":"CRAN release: 2023-10-11 Initial CRAN submission.","code":""}]
+[{"path":"https://posit-dev.github.io/r-shinylive/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 shinylive authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Barret Schloerke. Author, maintainer. Winston Chang. Author. George Stagg. Contributor. . Copyright holder, funder.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Schloerke B, Chang W (2024). shinylive: Run 'shiny' Applications Browser. R package version 0.1.1.9000, https://github.com/posit-dev/r-shinylive, https://posit-dev.github.io/r-shinylive/.","code":"@Manual{, title = {shinylive: Run 'shiny' Applications in the Browser}, author = {Barret Schloerke and Winston Chang}, year = {2024}, note = {R package version 0.1.1.9000, https://github.com/posit-dev/r-shinylive}, url = {https://posit-dev.github.io/r-shinylive/}, }"},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"shinylive","dir":"","previous_headings":"","what":"Run shiny Applications in the Browser","title":"Run shiny Applications in the Browser","text":"repository contains R package exporting Shiny applications Shinylive applications. repository https://github.com/posit-dev/shinylive repository. repository used generate Shinylive assets distribution, bundle containing HTML, JavaScript, CSS, wasm files. R package repository downloads assets uses create Shinylive applications. Twin shinylive python package: https://github.com/posit-dev/py-shinylive","code":""},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Run shiny Applications in the Browser","text":"can install released version shinylive CRAN via: can install development version shinylive GitHub via:","code":"install.packages(\"shinylive\") # install.packages(\"pak\") pak::pak(\"posit-dev/r-shinylive\")"},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Run shiny Applications in the Browser","text":"(Optional) Create basic shiny application new directory myapp/: Shiny application myapp/ like turn Shinylive app site/: can preview application running web server visiting browser: point, can deploy site/ directory static web hosting service.","code":"# Copy \"Hello World\" from `{shiny}` system.file(\"examples\", \"01_hello\", package=\"shiny\") |> fs::dir_copy(\"myapp\", overwrite = TRUE) shinylive::export(\"myapp\", \"site\") httpuv::runStaticServer(\"site/\")"},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"multiple-applications","dir":"","previous_headings":"Usage","what":"Multiple applications","title":"Run shiny Applications in the Browser","text":"multiple applications want put site, can export subdirectories site, can share Shinylive assets. can --subdir option:","code":"shinylive::export(\"myapp1\", \"site\", subdir = \"app1\") shinylive::export(\"myapp2\", \"site\", subdir = \"app2\")"},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"github-pages","dir":"","previous_headings":"Usage","what":"GitHub Pages","title":"Run shiny Applications in the Browser","text":"posit-dev/r-shiny workflow automatically deploy Shiny app root directory GitHub repository GitHub Pages. add workflow repository, call usethis::use_github_action(url=\"https://github.com/posit-dev/r-shinylive/blob/actions-v1/examples/deploy-app.yaml\"). information, see examples folder.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"r-package-availability","dir":"","previous_headings":"","what":"R package availability","title":"Run shiny Applications in the Browser","text":"shinylive web assets statically inspect packages used via renv. need package can found renv, add impossible--reach code within Shiny application library call R package. example: ’d rather handle manually, call webr::install(\"CRAN_PKG\") Shiny application calling library(CRAN_PKG) require(\"CRAN_PKG\"). R package trouble loading, visit https://repo.r-wasm.org/ see able installed precompiled WebAssembly binary. Note {webr}: possible install packages source webR. likely change near future, process require entire C Fortran compiler toolchain run inside browser. moment, providing pre-compiled WebAssembly binaries supported way install R packages webR.","code":"if (FALSE) { library(HIDDEN_CRAN_PKG) }"},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"shinylive-asset-management","dir":"","previous_headings":"","what":"Shinylive asset management","title":"Run shiny Applications in the Browser","text":"version Shinylive R package associated particular version Shinylive web assets. (See releases .) see version R package , version web assets associated , simply run shinylive::assets_info() R session. also show asset versions already installed locally: web assets downloaded cached first time run shinylive::export(). , can run shinylive::assets_download() fetch manually. can remove old versions shinylive::assets_cleanup(). remove versions except one Python package wants use: remove specific version, use shinylive::assets_remove():","code":"shinylive::assets_info() #> shinylive R package version: 0.1.0 #> shinylive web assets version: 0.2.1 #> #> Local cached shinylive asset dir: #> /Users/username/Library/Caches/shinylive #> #> Installed assets: #> /Users/username/Library/Caches/shinylive/0.2.1 #> /Users/username/Library/Caches/shinylive/0.2.0 shinylive::assets_download(\"0.1.5\") #> Downloading shinylive v0.1.5... #> Unzipping to /Users/username/Library/Caches/shinylive/ shinylive::assets_cleanup() #> Keeping version 0.2.1 #> Removing /Users/username/Library/Caches/shinylive/0.2.0 #> Removing /Users/username/Library/Caches/shinylive/0.1.5 shinylive::assets_remove(\"0.2.1\") #> Removing /Users/username/Library/Caches/shinylive/0.2.1"},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"known-limitations","dir":"","previous_headings":"","what":"Known limitations","title":"Run shiny Applications in the Browser","text":"possible install packages source webR. likely change near future, process require entire C Fortran compiler toolchain run inside browser. moment, providing pre-compiled WebAssembly binaries supported way install R packages webR.","code":""},{"path":[]},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"setup---shinylive-assets","dir":"","previous_headings":"Development","what":"Setup - shinylive assets","title":"Run shiny Applications in the Browser","text":"Works latest GitHub version posit-dev/shinylive (>= v0.2.1). linking shinylive assets asset cache folder, must first build shiny live assets: link assets (using shinylive R package) asset cache folder changes assets automatically cached shinylive assets:","code":"## In your shinylive assets repo # cd PATH/TO/posit-dev/shinylive # Generate the shiny live assets make submodules all # Link to your local shinylive repo shinylive::assets_install_link(\"PATH/TO/posit-dev/shinylive\")"},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"setup---quarto","dir":"","previous_headings":"Development","what":"Setup - quarto","title":"Run shiny Applications in the Browser","text":"quarto project, call following lines terminal install updated shinylive quarto extension: default, extension used installed shinylive R package. use local shinylive R package, run following R session update quarto extension locally:","code":"# Go to the quarto project directory cd local/quarto # Install the updated shinylive quarto extension quarto add quarto-ext/shinylive if (!require(\"pkgload\")) install.packages(\"pkgload\") shinylive_lua <- file.path(\"local\", \"quarto\", \"_extensions\", \"quarto-ext\", \"shinylive\", \"shinylive.lua\") shinylive_lua |> brio::read_file() |> sub( pattern = \"shinylive::quarto_ext()\", replacement = \"pkgload::load_all('../../', quiet = TRUE); shinylive::quarto_ext()\", fixed = TRUE ) |> brio::write_file(shinylive_lua)"},{"path":"https://posit-dev.github.io/r-shinylive/index.html","id":"execute---export","dir":"","previous_headings":"Development","what":"Execute - export()","title":"Run shiny Applications in the Browser","text":"Export local app directory run :","code":"library(httpuv) # >= 1.6.12 pkgload::load_all() # Delete prior unlink(\"local/shiny-apps-out/\", recursive = TRUE) export(\"local/shiny-apps/simple-r\", \"local/shiny-apps-out\") # Host the local directory httpuv::runStaticServer(\"local/shiny-apps-out/\")"},{"path":"https://posit-dev.github.io/r-shinylive/reference/assets.html","id":null,"dir":"Reference","previous_headings":"","what":"Manage shinylive assets — assets_download","title":"Manage shinylive assets — assets_download","text":"Helper methods managing shinylive assets.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/assets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Manage shinylive assets — assets_download","text":"","code":"assets_download( version = assets_version(), ..., dir = assets_cache_dir(), url = assets_bundle_url(version) ) assets_ensure( version = assets_version(), ..., dir = assets_cache_dir(), url = assets_bundle_url(version) ) assets_cleanup(..., dir = assets_cache_dir()) assets_remove(versions, ..., dir = assets_cache_dir()) assets_info() assets_version()"},{"path":"https://posit-dev.github.io/r-shinylive/reference/assets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Manage shinylive assets — assets_download","text":"version version assets download. ... Ignored. dir asset cache directory. Unless testing, default behavior used. url URL download assets . Unless testing, default behavior used. versions assets versions remove.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/assets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Manage shinylive assets — assets_download","text":"assets_version() returns version currently supported Shinylive. methods return invisible().","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/assets.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Manage shinylive assets — assets_download","text":"assets_download(): Downloads shinylive assets bundle GitHub extracts specified directory. bundle always downloaded GitHub, even already exists cache directory (dir=). assets_ensure(): Ensures local copy shinylive installed. local copy shinylive installed, downloaded installed. local copy shinylive installed, path returned. assets_cleanup(): Removes local copies shinylive web assets, except one used current version shinylive. assets_remove(): Removes local copies shinylive web assets. assets_info(): Prints information local shinylive assets installed. assets_version(): Returns version currently supported Shinylive assets version.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/export.html","id":null,"dir":"Reference","previous_headings":"","what":"Export a Shiny app to a directory — export","title":"Export a Shiny app to a directory — export","text":"function exports Shiny app directory, can served using httpuv.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/export.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export a Shiny app to a directory — export","text":"","code":"export(appdir, destdir, ..., subdir = \"\", verbose = is_interactive())"},{"path":"https://posit-dev.github.io/r-shinylive/reference/export.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export a Shiny app to a directory — export","text":"appdir Directory containing application. destdir Destination directory. ... Ignored subdir Subdirectory destdir write app . verbose Print verbose output. Defaults TRUE running interactively.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/export.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export a Shiny app to a directory — export","text":"Nothing. app exported destdir. Instructions serving directory printed stdout.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/export.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export a Shiny app to a directory — export","text":"","code":"if (FALSE) { # interactive() app_dir <- system.file(\"examples\", \"01_hello\", package = \"shiny\") out_dir <- tempfile(\"shinylive-export\") # Export the app to a directory export(app_dir, out_dir) # Serve the exported directory if (require(httpuv)) { httpuv::runStaticServer(out_dir) } }"},{"path":"https://posit-dev.github.io/r-shinylive/reference/install.html","id":null,"dir":"Reference","previous_headings":"","what":"Install shinylive assets from from a local directory — assets_install_copy","title":"Install shinylive assets from from a local directory — assets_install_copy","text":"Helper methods testing updates shinylive assets.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/install.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Install shinylive assets from from a local directory — assets_install_copy","text":"","code":"assets_install_copy( assets_repo_dir, ..., dir = assets_cache_dir(), version = package_json_version(assets_repo_dir) ) assets_install_link( assets_repo_dir, ..., dir = assets_cache_dir(), version = package_json_version(assets_repo_dir) )"},{"path":"https://posit-dev.github.io/r-shinylive/reference/install.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Install shinylive assets from from a local directory — assets_install_copy","text":"assets_repo_dir local repository directory shinylive assets (e.g. posit-dev/shinylive) ... Ignored. dir asset cache directory. Unless testing, default behavior used. version version assets installed.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/install.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Install shinylive assets from from a local directory — assets_install_copy","text":"method return invisible().","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/install.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Install shinylive assets from from a local directory — assets_install_copy","text":"assets_install_copy(): Copies shinylive assets local shinylive repository (e.g. posit-dev/shinylive). must repeated change assets. assets_install_link(): Creates symlink local shinylive assets cached assets directory. first installation, assets source due symlink.","code":""},{"path":[]},{"path":"https://posit-dev.github.io/r-shinylive/reference/quarto_ext.html","id":null,"dir":"Reference","previous_headings":"","what":"Quarto extension for shinylive — quarto_ext","title":"Quarto extension for shinylive — quarto_ext","text":"Integration https://github.com/quarto-ext/shinylive","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/quarto_ext.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Quarto extension for shinylive — quarto_ext","text":"","code":"quarto_ext( args = commandArgs(trailingOnly = TRUE), ..., pretty = is_interactive() )"},{"path":"https://posit-dev.github.io/r-shinylive/reference/quarto_ext.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Quarto extension for shinylive — quarto_ext","text":"args Command line arguments passed extension. See details information. ... Ignored. pretty Whether pretty print JSON output.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/quarto_ext.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Quarto extension for shinylive — quarto_ext","text":"Nothing. Values printed stdout.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/quarto_ext.html","id":"command-arguments","dir":"Reference","previous_headings":"","what":"Command arguments","title":"Quarto extension for shinylive — quarto_ext","text":"first argument must \"extension\". done match py-shinylive can nest sub-commands extension argument minimize api clutter user can see.","code":""},{"path":"https://posit-dev.github.io/r-shinylive/reference/quarto_ext.html","id":"cli-interface","dir":"Reference","previous_headings":"","what":"CLI Interface","title":"Quarto extension for shinylive — quarto_ext","text":"extension info Prints information extension including: version: version R package assets_version: version web assets scripts: list paths scripts used extension, mainly codeblock--json Example extension base-htmldeps Prints language agnostic quarto html dependencies JSON array. first html dependency shinylive service workers. second html dependency shinylive base dependencies. dependency contain core shinylive asset scripts (JS files automatically sourced), stylesheets (CSS files automatically included), resources (additional files JS CSS files can source). Example extension language-resources Prints language-specific resource files JSON added quarto html dependency. r-shinylive, includes webr resource files py-shinylive, includes pyodide pyright resource files. Example extension app-resources Prints app-specific resource files JSON added \"shinylive\" quarto html dependency. Currently, r-shinylive return resource files. Example","code":"{ \"version\": \"0.1.0\", \"assets_version\": \"0.2.0\", \"scripts\": { \"codeblock-to-json\": \"//shinylive-0.2.0/scripts/codeblock-to-json.js\" } } [ { \"name\": \"shinylive-serviceworker\", \"version\": \"0.2.0\", \"meta\": { \"shinylive:serviceworker_dir\": \".\" }, \"serviceworkers\": [ { \"source\": \"//shinylive-0.2.0/shinylive-sw.js\", \"destination\": \"/shinylive-sw.js\" } ] }, { \"name\": \"shinylive\", \"version\": \"0.2.0\", \"scripts\": [{ \"name\": \"shinylive/load-shinylive-sw.js\", \"path\": \"//shinylive-0.2.0/shinylive/load-shinylive-sw.js\", \"attribs\": { \"type\": \"module\" } }], \"stylesheets\": [{ \"name\": \"shinylive/shinylive.css\", \"path\": \"//shinylive-0.2.0/shinylive/shinylive.css\" }], \"resources\": [ { \"name\": \"shinylive/shinylive.js\", \"path\": \"//shinylive-0.2.0/shinylive/shinylive.js\" }, ... # [ truncated ] ] } ] [ { \"name\": \"shinylive/webr/esbuild.d.ts\", \"path\": \"//shinylive-0.2.0/shinylive/webr/esbuild.d.ts\" }, { \"name\": \"shinylive/webr/libRblas.so\", \"path\": \"//shinylive-0.2.0/shinylive/webr/libRblas.so\" }, ... # [ truncated ] ] [ { \"name\": \"shinylive/pyodide/anyio-3.7.0-py3-none-any.whl\", \"path\": \"//shinylive-0.2.0/shinylive/pyodide/anyio-3.7.0-py3-none-any.whl\" }, { \"name\": \"shinylive/pyodide/appdirs-1.4.4-py2.py3-none-any.whl\", \"path\": \"//shinylive-0.2.0/shinylive/pyodide/appdirs-1.4.4-py2.py3-none-any.whl\" }, ... # [ truncated ] ]"},{"path":[]},{"path":"https://posit-dev.github.io/r-shinylive/news/index.html","id":"shinylive-011","dir":"Changelog","previous_headings":"","what":"shinylive 0.1.1","title":"shinylive 0.1.1","text":"CRAN release: 2023-12-04 Bump shinylive assets dependency 0.2.3. (#38) Use httpuv serve static folder instead plumber. (#40) Use httr2 download assets GitHub releases. (@dgkf #30, #39)","code":""},{"path":"https://posit-dev.github.io/r-shinylive/news/index.html","id":"shinylive-010","dir":"Changelog","previous_headings":"","what":"shinylive 0.1.0","title":"shinylive 0.1.0","text":"CRAN release: 2023-10-11 Initial CRAN submission.","code":""}]