Description
Bug description
Given a main qmd document test.qmd
, when specifying the params externally in a params.yml
file and trying the quarto render test.qmd --execute-params params.yaml
the parameters are only updated in the portion of executable code (e.g. those included within an R chunk), but not for the shortcodes. Is this an intentional behaviour?
Steps to reproduce
test.qmd
---
title: "Conditional content with params"
format: html
editor: visual
params:
print: FALSE
---
::: {.content-hidden unless-meta="params.print"}
If PRINT parameter is TRUE, we'll show this.
shortcode shows PRINT = {{< meta params.print >}}
```{r, echo=FALSE}
cat("executed code shows PRINT = ", params$print)
if(params$print){
cat("Hello World")
} else {
cat("Not printing anything, because params$print is FALSE")
}
```
:::
::: {.content-hidden when-meta="params.print"}
If PRINT parameter is FALSE, we'll show this instead.
shortcode shows PRINT = {{< meta params.print >}}
```{r, echo=FALSE}
cat("executed code shows PRINT = ", params$print)
if(params$print){
cat("Hello World")
} else {
cat("Not printing anything, because params$print is FALSE")
}
```
:::
params.yml
print: FALSE
Expected behavior
Conditional content with params
If PRINT parameter is FALSE, we’ll show this instead.
shortcode shows PRINT = false
executed code shows PRINT = FALSE
Not printing anything, because params$print is FALSE
Actual behavior
Conditional content with params
If PRINT parameter is FALSE, we'll show this.
shortcode shows PRINT = true
executed code shows PRINT = FALSE
Not printing anything, because params$print is FALSE
Your environment
- IDE: Rstudio 2024.04.2+764
- OS: Windows 10 22H2
Quarto check output
Quarto 1.4.555
[>] Checking versions of quarto binary dependencies...
Pandoc version 3.1.11: OK
Dart Sass version 1.69.5: OK
Deno version 1.37.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.4.555
CodePage: 1252
[>] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
[>] Checking LaTeX....................OK
Tex: (not detected)
[>] Checking basic markdown render....OK
[>] Checking Python 3 installation....OK
Version: 3.11.2
Jupyter: 5.2.0
Kernels: python3
[>] Checking Jupyter engine render....OK
[>] Checking R installation...........OK
Version: 4.4.1
knitr: 1.48
rmarkdown: 2.28
[>] Checking Knitr engine render......OK