-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add new 'r.rmarkdownRender' command #3308
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR does not provide support for previewing any R Markdown, only doing rmarkdown::render()
.
}, | ||
{ | ||
"command": "r.rmarkdownRender", | ||
"icon": "$(play)", | ||
"title": "%r.command.rmarkdownRender.title%", | ||
"when": "(resourceExtname == '.rmd' || resourceExtname == '.Rmd') && !isInDiffEditor" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ | ||
"category": "R", | ||
"command": "r.rmarkdownRender", | ||
"icon": "$(play)", | ||
"title": "%r.command.rmarkdownRender.title%", | ||
"when": "resourceExtname == '.rmd' || resourceExtname == '.Rmd'" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intent
Addresses #1421 by adding a command to do
rmarkdown::render()
in a fresh R session (i.e. R terminal)Approach
This PR adds a command that is similar to
'r.sourceCurrentFile'
but checks to see if rmarkdown is installed and runs it in a new terminal.QA Notes
We should check how this command works both with/without the Quarto extension installed. It contributes both a command to the command palette and to the "editor/title/run" bar, but only for
.Rmd
and not.qmd
. The'r.sourceCurrentFile'
command should all still work as expected.You can make a file saved as
.Rmd
such as this: