Replies: 1 comment 1 reply
-
As documented, the include shortcode is a copy/paste shortcode, nothing more. If you don't like knitr/reticulate, you can do Jupyter/rpy2 (https://rpy2.github.io/doc/latest/html/introduction.html). What you want seems to be the embed shortcode: https://quarto.org/docs/authoring/notebook-embed.html |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Related: #4232, #8253
From my reading, it seems to use multiple languages in the same project, one needs to use an engine capable of both, e.g. the
knitr
engine withreticulate
. I've had mixed results withreticulate
and would prefer to use straight python, if possible.If what I show below is simply not possible, consider me testing the waters of a feature request. We are structuring a living analysis document, and I envision members contributing by taking a narrow hypothesis and exploring it various ways. Each will be an isolated, single-language "card", with all analysis cards included via
{{ < include _foo.qmd > }}
in a main document as we write them.Is there no setup/set of options where I could do something like this?
main_document.qmd
section_R.qmd
section_py.qmd
My thinking was that if one could cache/freeze the results of the code-containing .qmd cards, the top level document would not need to invoke an engine at all, but simply assemble the parent/children htmls.
Is there any appetite for something like this? It would be a dream if quarto had an option to load up the R engine, compile all includes which set the engine to
knitr
and do the same for all that set the engine tojupyter/python
.Looking at the questions from @cscheid in #4232 (the closest existing discussion I found), here's a stab:
I am proposing a single-language-per-file approach, so order doesn't matter (in as much as order does/doesn't matter in any other single-language use case). Maybe this is not sufficiently compelling, as I just want to avoid reticulate.
Functionally, this would be like having two files or two projects with only R or python includes, rendering both separately, then stitching together sections from the resultant htmls in one's desired order.
I don't have enough context for the confusion you've already faced, but trivially: add more to your [already comprehensive/pretty excellent] docs :)
I'm cheating by rendering this a non-question. In my case, the path I was headed down was to have separate R and python files load from our db, do some ETL, and then make objects of the same name available in either environment. In this way users can write up their analysis "card" and assume that e.g.
df
includes with the same structure, whether they want to do the analysis in python or R.That's done in some setup code, which from my testing seems to be available to all subsequent includes [using the same engine].
Thanks for taking a look; again, maybe avoiding reticulate is a pretty silly motivation. I've run into some oddities before in brief exploration of it and it just feels cleaner to use python directly. Maybe others have alternative use cases for this, however, as there's a decent number of questions about mixed languages (e.g. scenarios where a single engine doesn't exist which can handle both languages).
Beta Was this translation helpful? Give feedback.
All reactions