posit-dev / positron

Positron, a next-generation data science IDE
Other
2.3k stars 68 forks source link

R: Avoid rioting in streets by supporting R Markdown in Positron #1421

Open jmcphers opened 11 months ago

jmcphers commented 11 months ago

Goal

Support for R Markdown. We don't need to knock it out of the park, but we do need support for the basics:

This should look a lot like what the Quarto extension does since the two have a lot of similarities.

Context

via @jjallaire:

Note that Positron currently does not support R Markdown and we don't have plans to add this unless there is rioting in the streets about it

Via @hadley:

I predict that you will need some basic Rmd support or there will be rioting

Via @DavisVaughan:

I think we have determined there would be rioting in the streets

Slack threads:

https://positpbc.slack.com/archives/C05M2EZCPGR/p1695387572152429 https://positpbc.slack.com/archives/C05M2EZCPGR/p1695737806600509

Support features in the existing VS Code R language support plugin:

https://github.com/REditorSupport/vscode-R/wiki/R-Markdown

jmcphers commented 11 months ago

See also discussion in #1043; the Quarto extension does provide some R Markdown functionality (but doesn't use R Markdown for rendering)

https://github.com/posit-dev/positron/issues/1043#issuecomment-1678333119

gadenbuie commented 11 months ago

IMHO, it'd be great for the basic feature set to include drafting new R Markdown documents via package-provided templates. (The interface for doing this doesn't need to be as robust initially as RStudio's.)

juliasilge commented 7 months ago

Quarto is available on CRAN servers and we can advise folks to use Quarto for vignettes.

jmcphers commented 6 months ago

Bumping this to Future since I think we'll have to lean on the Quarto extension for R Markdown in the short term (and perhaps even for RC).

juliasilge commented 3 months ago

As outlined earlier in this issue, Quarto does provide some R Markdown functionality but doesn't use rmarkdown::render() for rendering. For many situations, we believe this will be acceptable, for example, generating a preview of README.Rmd or R package vignettes. (Note that we know the preview using Quarto will not be the same as, say, the final HTML vignettes as CRAN will render them.)

The remaining challenges around .Rmd are most dramatic for situations where you really do need rmarkdown::render(), like for custom R Markdown formats such as those outlined in https://github.com/posit-dev/positron/issues/1471#issuecomment-2038330413 and the following discussion. We could consider making a command in the R extension that literally uses rmarkdown::render() and then somehow renders a preview (using Quarto??? or we resolve #2559?) in the Viewer pane.

Note that even today folks do have the ability to run rmarkdown::render() from the console and then get their expected generated files. We are mostly talking about previews and UI affordances like keyboard shortcuts.