Open psychemedia opened 8 months ago
On the first request regarding packages, the plan here is to allow for package loading via packages
key, e.g.
pyodide:
packages:
- package: 'pkg1'
- package: 'pkg2'
alias: pd
- package: 'https://example.com/files/pkg3-2.0.0-py2.py3-none-any.whl'
Packages would be installed via:
import micropip
for pkg in {{packages}}:
micropip.install(
pkg
)
Then imported using:
import {{pkg}}
or
import {{pkg}} as {{alias}}
For the second request regarding injecting the setup code before the cells are unlocked, we'd likely want to add an include-script-header
designation that runs after all packages are installed, e.g.
---
pyodide:
include-script-header: |
pd.options.display.max_rows = 5
---
Feature Description
I notice that you do some of the lifting to get
matplotlib
charts to work via JS in each rendered page:I wonder if it would also be useful to allow config either globally or locally that would allow a user to specify in header or
_quarto.yml
things like:which would create something like:
await mainPyodide.loadPackage("pandas");
or optionally something like:
to generate:
Alternatively, keep
pyodide-pip
as a simple list and then allow: