You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Still looking for a good solution to #135, I found https://github.com/minrk/allthekernels which seems like a great candidate: it's a simple Jupyter kernel that forwards code cells to different sub-kernels for different languages (this also seems to be the approach favored by the Jupyter developers, see jupyterlab/jupyterlab#2815).
However I found some issues trying to use it with Quarto. Here's my test document a.qmd:
First, two issues that should be fixed outside of Quarto I think:
Calling quarto render a.qmd gives ERROR: TypeError: Cannot read properties of undefined (reading 'toLowerCase'). This is because the kernel.json doesn't define a language. The language key is required so this should probably be fixed in allthekernels. I fixed it by adding "language": "any" in the kernel.json.
With the above fix, calling quarto render a.qmd sometimes produces an HTML file with code cells but empty outputs. It looks like a latency issue: it normally works the second time (once the daemon is running). The same issue can be observed when running the cells in Jupyter Notebook so it's probably a problem in allthekernels.
Now the issue that should be fixed in Quarto I think: The execution requires that I mark code blocks with {any} to match the language declared in kernel.json. Due to this the code blocks are not formatted properly: no syntax highlighting and not even a gray background. What I would expect instead is to write
```{octave}
>octave
plot(magic(2))
2+2
```
and have it work as long as I have defined jupyter: atk. If this worked I could also write a Lua filter to infer the >octave line from the block language and insert it automatically.
Note: the same issue affects the SoS kernel (another polyglot kernel that additionally enables data exchange between the sub-kernels).
Tested with quarto 1.2.269 and 1.3.26 on Pop!_OS 22.04.
Checklist
Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
Please format your issue so it is easier for us to read the bug report.
Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
Please document the operating system you're running. If on Linux, please provide the specific distribution.
The text was updated successfully, but these errors were encountered:
Maybe it's useful to explain while knitr is not good enough... Knitr is great for mixing R, Python and Julia thanks to reticulate and JuliaCall, but for other languages it's very limited: each cell is run in a different session and graphical outputs are not displayed. The proxy kernel approach doesn't have these problems, and for each language it gives access to the features of the specialized kernel (configuration, magics...)
Bug description
Still looking for a good solution to #135, I found https://github.com/minrk/allthekernels which seems like a great candidate: it's a simple Jupyter kernel that forwards code cells to different sub-kernels for different languages (this also seems to be the approach favored by the Jupyter developers, see jupyterlab/jupyterlab#2815).
However I found some issues trying to use it with Quarto. Here's my test document
a.qmd
:First, two issues that should be fixed outside of Quarto I think:
Calling
quarto render a.qmd
givesERROR: TypeError: Cannot read properties of undefined (reading 'toLowerCase')
. This is because thekernel.json
doesn't define a language. The language key is required so this should probably be fixed in allthekernels. I fixed it by adding"language": "any"
in thekernel.json
.With the above fix, calling
quarto render a.qmd
sometimes produces an HTML file with code cells but empty outputs. It looks like a latency issue: it normally works the second time (once the daemon is running). The same issue can be observed when running the cells in Jupyter Notebook so it's probably a problem in allthekernels.Now the issue that should be fixed in Quarto I think: The execution requires that I mark code blocks with
{any}
to match the language declared inkernel.json
. Due to this the code blocks are not formatted properly: no syntax highlighting and not even a gray background. What I would expect instead is to writeand have it work as long as I have defined
jupyter: atk
. If this worked I could also write a Lua filter to infer the>octave
line from the block language and insert it automatically.Note: the same issue affects the SoS kernel (another polyglot kernel that additionally enables data exchange between the sub-kernels).
Tested with quarto 1.2.269 and 1.3.26 on Pop!_OS 22.04.
Checklist
The text was updated successfully, but these errors were encountered: