posit-dev / shinylive

Run Shiny on Python and R (compiled to wasm) in the browser
https://shinylive.io/py/examples/
MIT License
211 stars 19 forks source link

Update docs to explain how to test in Quarto #139

Open gadenbuie opened 5 months ago

gadenbuie commented 5 months ago

The README describes two make targets -- make quarto and make quartoserve -- that would, in theory, be used to test in-dev shinylive in Quarto.

These targets appear to be vestigal: the quarto/ directory was removed some time ago. Because this repo is tightly coupled with the quarto shinylive extension (at least in the sense that some issues that appear in the extension are solved here in this repo), it would be helpful to update the instructions to describe how to test in-dev shinylive in Quarto.

gadenbuie commented 5 months ago

Here's what worked for me:

Setup local dev:

make clean
make submodules
make all

Then create a new document for testing

mkdir -p _dev/my-test/
touch _dev/my-test/test.qmd
touch _dev/my-test/_quarto.yml

Then set up a new venv for this document

cd _dev/my-test
# deactivate (if any venvs are currently active)

# start a new venv
uv venv
. .venv/bin/activate

# install py-shinylive in this new venv
uv pip install shinylive

# Link the shinylive in the newly activated venv to the dev build
shinylive assets link-from-local ../../build

# Preview the quarto doc
quarto preview test.qmd

In a separate terminal, watch and rebuild the assets as you work

make watch