Skip to content

Add params to Quarto/R Markdown notebook environments#13418

Closed
jmcphers wants to merge 5 commits into
mainfrom
feature/quarto-params
Closed

Add params to Quarto/R Markdown notebook environments#13418
jmcphers wants to merge 5 commits into
mainfrom
feature/quarto-params

Conversation

@jmcphers
Copy link
Copy Markdown
Collaborator

@jmcphers jmcphers commented May 6, 2026

This change adds basic support for parameterized Quarto documents to Positron when using inline output.

image

The approach is a little different than RStudio's; since Positron doesn't have to worry about params conflicting between documents, it creates the params value in the session right after starting the session, and updates it immediately when the YAML changes, using mostly TS parsing to avoid R package dependencies. This results in a good autocomplete experience and immediate feedback when changing the params.

Some important notes/caveats:

  • This only applies to R documents, since Python document "parameters" are just a cell with a tag. The only support I can think of us offering here is automatically running this cell at startup and when the cell changes, which might not be desirable -- unlike R, you can just run the cell yourself and it gets run automatically with e.g. "run cells above".
  • This change does not implement the "Run with Parameters" UI.
  • You must use inline output to have params populated, since the parameters are stored in the per-document kernel.
  • There is currently an issue in the R kernel which delays the update events for variables assigned or created with evaluateCode, so when you change params you will not see the Variables pane update right away. Inspecting the value in the Console (or just running any R code) will trigger an update.

Fixes #4338.

Release Notes

New Features

  • N/A

Bug Fixes

  • N/A

Validation Steps

The change includes unit and E2E tests. I've also added a Quarto document in posit-dev/qa-example-content#129 that contains several examples of different kinds of parameters along with documentation on their expected values.

References for expected behavior and further test examples:

https://quarto.org/docs/computations/parameters.html

https://yihui.org/rmarkdown/params-knit

Test tags: @:quarto

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:quarto

readme  valid tags

@jmcphers
Copy link
Copy Markdown
Collaborator Author

jmcphers commented May 6, 2026

Closing to reconsider whether we really want to support knitr-style params given Quarto engine transition plans to ark in #13145.

@jmcphers jmcphers closed this May 6, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators May 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RMD Documents with params set do not create the params object when run interactively

1 participant