Skip to content

Commit

Permalink
Merge branch 'main' into x_into_main
Browse files Browse the repository at this point in the history
* main:
  Remove leading newline
  Stop testing on Python 3.12
  Update changelog
  Check that file is autogenerated before overwriting
  Run tests on Python 3.12
  Add support for Quarto integration (#746)
  Revert inadvertent whitespace change
  Update shinylive version for docs (#759)
  Self outputting renderers (#747)
  • Loading branch information
schloerke committed Oct 13, 2023
2 parents 331efc0 + 6225a0e commit 9f7d9f6
Show file tree
Hide file tree
Showing 25 changed files with 949 additions and 102 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### New features

* The `@output` decorator is no longer required for rendering functions; `@render.xxx` decorators now register themselves automatically. You can still use `@output` explicitly if you need to set specific output options (#747).
* Added support for integration with Quarto (#746).
* Added `shiny.render.renderer_components` decorator to help create new output renderers (#621).
* Added `shiny.experimental.ui.popover()`, `update_popover()`, and `toggle_popover()` for easy creation (and server-side updating) of [Bootstrap popovers](https://getbootstrap.com/docs/5.2/components/popovers/). Popovers are similar to tooltips, but are more persistent, and should primarily be used with button-like UI elements (e.g. `input_action_button()` or icons) (#680).
* Added CSS classes to UI input methods (#680) .
Expand Down
126 changes: 126 additions & 0 deletions docs/_extensions/quarto-ext/shinylive/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# Shinylive package methods

## Methods

### R

Interaction:

```
Rscript -e 'shinylive:::quarto_ext()' [methods] [args]
```

### Python

Interaction:

```
shinylive [methods] [args]
```

## CLI Methods

* `extension info`
* Package, version, asset version, and script paths information
* `extension base-htmldeps`
* Quarto html dependencies for the base shinylive integration
* `extension language-resources`
* Language specific resource files for the quarto html dependency named `shinylive`
* `extension app-resources`
* App specific resource files for the quarto html dependency named `shinylive`

### CLI Interface
* `extension info`
* Prints information about the extension including:
* `version`: The version of the R package
* `assets_version`: The version of the web assets
* `scripts`: A list of paths scripts that are used by the extension,
mainly `codeblock-to-json`
* Example
```
{
"version": "0.1.0",
"assets_version": "0.2.0",
"scripts": {
"codeblock-to-json": "/<ASSETS_CACHE_DIR>/shinylive-0.2.0/scripts/codeblock-to-json.js"
}
}
```
* `extension base-htmldeps`
* Prints the language agnostic quarto html dependencies as a JSON array.
* The first html dependency is the `shinylive` service workers.
* The second html dependency is the `shinylive` base dependencies. This
dependency will contain the core `shinylive` asset scripts (JS files
automatically sourced), stylesheets (CSS files that are automatically
included), and resources (additional files that the JS and CSS files can
source).
* Example
```
[
{
"name": "shinylive-serviceworker",
"version": "0.2.0",
"meta": { "shinylive:serviceworker_dir": "." },
"serviceworkers": [
{
"source": "/<ASSETS_CACHE_DIR>/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": "/<ASSETS_CACHE_DIR>/shinylive-0.2.0/shinylive/load-shinylive-sw.js",
"attribs": { "type": "module" }
}],
"stylesheets": [{
"name": "shinylive/shinylive.css",
"path": "/<ASSETS_CACHE_DIR>/shinylive-0.2.0/shinylive/shinylive.css"
}],
"resources": [
{
"name": "shinylive/shinylive.js",
"path": "/<ASSETS_CACHE_DIR>/shinylive-0.2.0/shinylive/shinylive.js"
},
... # [ truncated ]
]
}
]
```
* `extension language-resources`
* Prints the language-specific resource files as JSON that should be added to the quarto html dependency.
* For r-shinylive, this includes the webr resource files
* For py-shinylive, this includes the pyodide and pyright resource files.
* Example
```
[
{
"name": "shinylive/webr/esbuild.d.ts",
"path": "/<ASSETS_CACHE_DIR>/shinylive-0.2.0/shinylive/webr/esbuild.d.ts"
},
{
"name": "shinylive/webr/libRblas.so",
"path": "/<ASSETS_CACHE_DIR>/shinylive-0.2.0/shinylive/webr/libRblas.so"
},
... # [ truncated ]
]
* `extension app-resources`
* Prints app-specific resource files as JSON that should be added to the `"shinylive"` quarto html dependency.
* Currently, r-shinylive does not return any resource files.
* Example
```
[
{
"name": "shinylive/pyodide/anyio-3.7.0-py3-none-any.whl",
"path": "/<ASSETS_CACHE_DIR>/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": "/<ASSETS_CACHE_DIR>/shinylive-0.2.0/shinylive/pyodide/appdirs-1.4.4-py2.py3-none-any.whl"
},
... # [ truncated ]
]
```
2 changes: 1 addition & 1 deletion docs/_extensions/quarto-ext/shinylive/_extension.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: shinylive
title: Embedded Shinylive applications
author: Winston Chang
version: 0.0.3
version: 0.1.0
quarto-required: ">=1.2.198"
contributes:
filters:
Expand Down
Loading

0 comments on commit 9f7d9f6

Please sign in to comment.