rstudio / rstudio

RStudio is an integrated development environment (IDE) for R
https://posit.co/products/open-source/rstudio/
Other
4.65k stars 1.09k forks source link

.qmd files as document templates #11316

Open Robinlovelace opened 2 years ago

Robinlovelace commented 2 years ago

I'm not 100% sure this is a new feature request, or even whether this is the right repo to open such an issue, but it could be cool and useful to be able to select templates for .qmd documents in the same way you can for .Rmd documents. In the below screenshot I guess my feature request is for a new option underneath 'Interactive' called "Template" or similar. This would enable/encourage others to develop their own .qmd style documents as enabled/encouraged by the rticles package (where I thought about opening this issue).

image

A way of creating .qmds based on templates from the command line, e.g. with rstudioapi, would also be on my wish list although that may be best handled by things external to RStudio. Apologies if you're already on the case with this and hope this request is of use/interest in any case!

ronblum commented 2 years ago

@Robinlovelace Thank you for the suggestion! I was actually considering asking for this enhancement request, although I don't know if this is intentional or on the roadmap. I'll tag it as a request. Also, this is the right repo 👍, since it would be a change in the IDE's support of Quarto, rather than Quarto itself.

RaymondBalise commented 2 years ago

My package rUM adds Rmd templates (among other things) and I would love to be able to add Quarto templates. I just can't miss the chance to add "quart o rUM" templates in the next release of rUM. So 👍 @Robinlovelace and 🙏 @ronblum.

ronblum commented 2 years ago

@RaymondBalise Re-reading this, if I understand correctly, you're looking for a change in Quarto using the command line interface, not specific to RStudio. Is this correct?

(I missed this the first time because I was too busy laughing at the joke. 😄 )

RaymondBalise commented 2 years ago

@ronblum I am hoping for a tweak to the IDE. Currently I can do File>New File>R Markdown... and then choose From Template and pick one of the rUM templates that I added into the rUM package. When I do File>New File>Quarto Document there is no From Template option. When I tried to add the directories needed for the additional templates (in the rUM package) it did not recognize the directory that would hold new templates. For example, this is the path needed for adding R Markdown templates:

image

I tried to replace "rmakdown" in the path with "quarto" in the path and the IDE did not recognize it.

I am giving a talk at the R Medicine conference in August called "A Quart o' rUM (Using the rUM Package for Reproducible Medical Research)". We have a new release of rUM ready to uncork. It includes a paper shell for a biomedical research project done in quarto but it can't include the other rUM templates that match what we built for R Markdown.

So, if there is any way to get the functionality for adding quarto templates into the daily builds of the IDE I would love to play. If I can help the developer(s) in any way just send up a flare.

cderv commented 2 years ago

@ronblum just to share for reference that there is also a related feature request in Quarto: https://github.com/quarto-dev/quarto-cli/issues/1111

Probably syncing effort on both side will be a way to make this comes true.

ronblum commented 2 years ago

Thanks all! I'll raise this.

Triage: See discussion above and in Quarto CLI request 1111.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.

cderv commented 1 year ago

We probably want to keep that open

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.

cderv commented 1 year ago

We probably want to keep that open

RaymondBalise commented 1 year ago

Yes please do. I would love to update my rUM package to include hooks into the IDE for Quarto. My students would certainly appreciate it. As it stands they have to go to download gists instead of just using the UI.

venpopov commented 7 months ago

Please do add this feature!

jthomasmock commented 6 months ago

I played around with creating a template through the RMarkdown system. This requires a template file in .Rmd OR .rmd and .qmd will not be recognized. See: https://github.com/rstudio/rstudio/pull/9454/files and https://github.com/rstudio/rstudio/blob/1520f3f0da08f4531c7e6a492d0fdde84dc573cd/src/cpp/session/modules/SessionRMarkdown.R#L264

Ironically, because a .rmd with Quarto yaml is treated like Quarto:

---
format: html
---

A .Rmd could be used to create a Quarto template and distribute through an R package.

RaymondBalise commented 6 months ago

Thanks for giving it a look Tom. I use the R Markdown templates that I baked into {rUM} to help novices get started. I really want to instead teach them with Quarto from the get-go. I think telling them to use the R Markdown templates to create a quarto document (and then to change the file suffix) would be bad mojo for absolute novices.

Given that Quarto can now nearly completely replace R Markdown, it would be extremely good, especially for instructors, if we could use/access a Quarto template store in the RStudio IDE.

isaactpetersen commented 4 months ago

I just want to add my voice in support of adding the option of using Quarto templates via RStudio dialogs (as is supported with R Markdown templates). This will allow Quarto to be more accessible, including to students. Thanks!

AaronRendahl commented 2 months ago

I'd love to have this too!

maldridgeepa commented 1 month ago

I'd also love this feature. we have created R project templates to standardize work products in our group, and this includes R-markdown templates. There are good applications for us to use quarto, but it currently requires more work because our document templates are not available in quarto.