Add params to Quarto/R Markdown notebook environments#13418
Closed
jmcphers wants to merge 5 commits into
Closed
Conversation
|
E2E Tests 🚀 |
Collaborator
Author
|
Closing to reconsider whether we really want to support knitr-style params given Quarto engine transition plans to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change adds basic support for parameterized Quarto documents to Positron when using inline output.
The approach is a little different than RStudio's; since Positron doesn't have to worry about
paramsconflicting between documents, it creates theparamsvalue 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:
paramspopulated, since the parameters are stored in the per-document kernel.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
Bug Fixes
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