-
Notifications
You must be signed in to change notification settings - Fork 30
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
Improve R package workspace detection and/or warn users #633
Comments
What is the reasoning for changing the behavior of Quarto Preview when being in the root of an R package? What is the benefit of rendering the documents with the --embed-resources options in this context? I usually like to perfom some adhoc analysis, say located in +1 to inform users about the different behavior because it took me a couple of minutes to figure out why Quarto Preview behaved differently. |
The reasoning is so that we get correct/expected behavior for |
@benesom Why do you have If you are using an IDE like VSCode, Codium, or Positron, instead you might want to create a workspace with the two directories as workspaces: your R package AND your "analysis. |
Thanks for the swift response. I'm aware that an I can always export the package, without the analyses, at at a later point. |
To my knowledge, idea of using R package for a research compendium has been around for a long time (Bryan et al. (2017), Marwick et al. (2018)) and some R packages on CRAN even help with that like rtools or rcompendium. In those usage, having .qmd / .Rmd inside usual package structure for analysis seems common and practical. Other use of non-conventional package are for ShinyApps when created with golem R package. Though in this context, I don't think .qmd / .Rmd would be used differently than through vignettes. Another example is having a book inside a R Package like historically the bookdown package which has the Bookdown book leaving in the same package for convenience (and added to I agree that there could be other ways to do it and clearly separate project. Though, possibly the detection should be made clever enough to account for those different use case. To me, this is worth thinking more about the proper solution for this 🤔 |
As a workaround for now, the current R package detection in the Quarto extension will not treat your workspace with the R package |
It's then not possible anymore to run |
Quarto Preview behaviour is changed depending on the context.
For instance, when a
DESCRIPTION
file (withPackage
orType
fields) is found at the root of the workspace/project,--embed-resources
is added to the command which lead to issues if not in the context of single file project (default type), such as website, books, etc.Users should be informed when an R package workspace has been detected.
quarto/apps/vscode/src/providers/preview/preview.ts
Line 453 in 57ed6fb
Alternatively, the logic could be extended to look for
_quarto.yml
as this file should not be there in an R package which would mean it's a Quarto project not an R package.quarto/apps/vscode/src/providers/preview/preview-util.ts
Lines 62 to 74 in 57ed6fb
The text was updated successfully, but these errors were encountered: