-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
revealjs does not work with knitr embed engine #4712
Comments
Have tried both |
The reason the report in #1237 isn't resolved for include specifically is that the include shortcode resolution happens in typescript, before Pandoc. Other shortcodes like meta, var, etc, happen in Lua. We need to add include processing to Lua in one shape or another, but this is easier said than done. We need to be aware of a number of issues, and it's also going to be the case that a "Lua |
@aronatkins Did you try pre release yet ? I can't reproduce with 1.3. From ---
title: embedding with reveal
format: revealjs
engine: knitr
---
## Embed!
```{embed, file = "code.R"}
``` I get But I can reproduce with verbatim. Using also knitr 1.42 Either some adjusments in quarto or something with knitr - I can have a look to this @cscheid |
Oh I know - this is a side effect of a default we have for revealjs.
We do that because minimal space on slides so by default we choose to hide code source. This is documented for this format. For We should probably handle specifically those engine with an option hook as they need to have |
In fact there is something new now since #3429 - v1.3 has added internally a For now we pass every cell handlers from quarto to knitr quarto-cli/src/resources/rmd/execute.R Lines 54 to 68 in 5e38e1e
This creates a conflict (and why I get something with 1.3 using @cscheid @dragonstyle do all the language handler we have are supposed to pass to knitr ? Does setting ```{embed} inside a document using knitr computation engine is supposed to be handled by our internal handler, or should we NOT overwrite knitr own @cscheid @dragonstyle I need your input before doing more I have a fix already for |
What I think we should do : I'll go with that, unless you think otherwise. |
…bed` handler Currently the `embed` handler is only for Jupyter. Discovered while looking at #4712 - revealjs does not work with knitr embed engine
…bed` handler Currently the `embed` handler is only for Jupyter. Discovered while looking at #4712 - revealjs does not work with knitr embed engine
In case others find this issue, #1237 suggested using the https://github.com/quarto-ext/include-code-files extension. This extension has worked and lets me include code from external files into a Quarto+revealjs presentation. |
This will be fixed by #4732 |
* Do not override the knitr's `embed` engine with internal quarto's `embed` handler Currently the `embed` handler is only for Jupyter. Discovered while looking at #4712 - revealjs does not work with knitr embed engine * Set echo = TRUE for embed and verbatim engine when revealjs because those engine expect echo, but revealjs default to FALSE * Add embed to ignored engine for chunk hook * Add test for knitr revealjs fix regarding verbatim and embed * Revert "Do not override the knitr's `embed` engine with internal quarto's `embed` handler" This reverts commit 53d8703. * Internal languages are only handlers of type cell Other language are shortcodes * For embed and verbatim engine, always set to TRUE This will avoid format defaulting to echo: false to hide those chunks
Bug description
Using Quarto 1.2.335 (which is included in recent RStudio dailies, including 2023.03.0+385). This problem can be recreated without using the RStudio IDE when rendering using Quarto from the command-line.
Given a
code.R
file:cat("this is code.R\n")
The following revealjs document does not show the embedded code:
The generated HTML contains a block, but no code:
In contrast, when we do not output to HTML, the embedded code is shown.
Using the most recent version of knitr from CRAN and R 3.6.3 on macOS 12.6.3.
Discovered while trying to apply the workaround from #1237
Checklist
The text was updated successfully, but these errors were encountered: