coatless-quarto / pyodide

Quarto extension to enable interactive Python code cells in HTML documents using Pyodide
http://quarto.thecoatlessprofessor.com/pyodide/
53 stars 3 forks source link

[feature]: hide code editor, support `#| context: output` #18

Open mattijn opened 2 months ago

mattijn commented 2 months ago

Feature Description

Thank you for developing this very interesting quarto extension!

The feature request that I like to raise is to have a context setting that disables the code editor, but runs the code cell upon opening the website.

After reading a bit more in the qwebr documentation, I find out that this requested setting is defined there under Run Options:

image

So the proposed option would be:

```{pyodide-python}
#| context: output

x = 1
x

This request is similar to https://github.com/coatless-quarto/pyodide/issues/17, but as it is another context setting, I thought I would raise it as a separate issue.

My end goal is to implement [this](https://github.com/vega/altair/discussions/3284#discussioncomment-7872928) proof of concept where two Vega-Altair charts (as JupyterChart components) are interacting with each other.

I've tried to do similar using the `quarto-stlite` extension ([link](https://github.com/whitphx/quarto-stlite)), but did not yet succeed either.

Thanks again for working on this!