Skip to content
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

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

Open
Tracked by #1542
jmcphers opened this issue Sep 26, 2023 · 10 comments
Open
Tracked by #1542

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

jmcphers opened this issue Sep 26, 2023 · 10 comments
Labels
Milestone

Comments

@jmcphers
Copy link
Collaborator

Goal

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

  • Run cells
  • Preview documents
  • Knit documents to format(s)
  • Publish documents
  • etc.

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
Copy link
Collaborator Author

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

#1043 (comment)

@gadenbuie
Copy link

gadenbuie commented Oct 4, 2023

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
Copy link
Contributor

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

@jmcphers jmcphers added this to the Future milestone Feb 20, 2024
@jmcphers
Copy link
Collaborator Author

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
Copy link
Contributor

juliasilge commented May 14, 2024

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 #1471 (comment) 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.

@kv9898
Copy link

kv9898 commented Oct 21, 2024

I noticed that the Quarto support for Rmarkdown in Positron is no longer present, is this intentional? It seems that the positron-r extension is overriding Quarto for rmd documents.

Image

I had to add the following to settings.json to make it work again:

"files.associations": {
        "*.rmd": "quarto",
    },

@juliasilge
Copy link
Contributor

@kv9898 I am not able to reproduce that problem with the latest release (2024.11.0 build 69):

Image

Can you check the details of what version you may be running? I suspect the problem is coming from another extension you have installed which is creating an association that is interfering with the Quarto support. I know, for example, there is a word count extension that creates a non-Quarto association for .Rmd which then means Quarto can't provide syntax highlighting or anything else.

@kv9898
Copy link

kv9898 commented Oct 22, 2024

@kv9898 I am not able to reproduce that problem with the latest release (2024.11.0 build 69):

Image

Can you check the details of what version you may be running? I suspect the problem is coming from another extension you have installed which is creating an association that is interfering with the Quarto support. I know, for example, there is a word count extension that creates a non-Quarto association for .Rmd which then means Quarto can't provide syntax highlighting or anything else.

I am using the word count extension! Thank you for looking this up. For now the fix I mentioned is working fine. I guess the extension only affects *.rmd but not *.qmd

@juliasilge
Copy link
Contributor

It's because that extension (if it's the same one) says that an .Rmd file is rmarkdown and not quarto:

https://github.com/yunier-olivera/markdown-quarto-word-count/blob/4480749cb27e560d9bfb48fe8cbcd1c58043d931/package.json#L63

@kv9898
Copy link

kv9898 commented Oct 22, 2024

It's because that extension (if it's the same one) says that an .Rmd file is rmarkdown and not quarto:

https://github.com/yunier-olivera/markdown-quarto-word-count/blob/4480749cb27e560d9bfb48fe8cbcd1c58043d931/package.json#L63

That makes a lot of sense! Thank you, @juliasilge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants