-
Notifications
You must be signed in to change notification settings - Fork 31
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
Render output in a temp directory, when in an R package #435
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.
"quarto.render.rPackageOutputDirectory": { | ||
"order": 15, | ||
"scope": "window", | ||
"type": "boolean", | ||
"default": true, | ||
"markdownDescription": "Render output files in a temporary directory, when in an R package." | ||
}, |
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.
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.
I would recommend doing a bit of work ahead of time to make sure that this is not going to create other bugs. In an R package, will users mostly preview README.md
files and vignettes? In that case, I wonder if the right behavior is to use --output-dir
only in these special cases.
Like we discussed, relocating files for an .html target is unlikely to be robust because of things like CSS resource paths; in that case, we tend to recommend to use --output-dir
together with embed-resources
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.
With that said, this is a pain in the neck to test in an automated fashion. It might be good enough to test this by making a mock test harness over at https://github.com/quarto-dev/quarto-cli. I can help with that; I think it's prudent to do it. Because quarto-cli
won't generally know the ways in which the extension calls quarto render
, quarto preview
etc, we have a pretty big regression risk unless we do something about it.
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.
In that case, I wonder if the right behavior is to use
--output-dir
only in these special cases.
I'm going to get some more feedback on this from folks, but my current belief is that there are basically no cases where you want to check in generated code such as HTML, libs, etc, for an R package.
The one exception is README.Rmd
being rendered to README.md
but a) none of that works for people right now because of output: github_document
and b) we can encourage them to use devtools::build_readme()
for this purpose. If we want to be more forward thinking, we could exclude README.Rmd
and README.qmd
from this treatment, rather than make a list of files to include for this treatment.
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.
I'm going to get some more feedback on this from folks, but my current belief is that there are basically no cases where you want to check in generated code such as HTML, libs, etc, for an R package.
I believe that! Really my only concern is that quarto preview
itself might break under common use cases in R packages, and I'd hate for us to enable something by default that doesn't work well in these scenarios.
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.
There's a catch { }
clause that I think we should be more careful about before merging, but this otherwise looks good.
This looks good from my end, so feel free to squash+merge it or let me know if you have no further changes to make! |
This PR updates the preview behavior so by default output files go to a temporary directory when the workspace is an R package.