always specify html_file on render() #75
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
On Windows, I am jumped to browsers every time I execute
reprex()
. This is a bit annoying. This PR is a temporal workaround to let RStudio on Windows use Viwer Pane. Note that, I guess this is up to RStudio and is not the fault of reprex package, but I think we'll need this for a while.According to this article, we have to place a HTML file in session temporary directory to render it in Viewer Pane:
But, currently, RStudio fails to recognize a tempdir is actually a tempdir, confused by the infamous "8.3 short filename". I mean,
tempdir()
function returns a path in short form like this (given that my username isusername
),"C:\\Users\\USERNA~1\\AppData\\Local\\Temp\\RtmpGSN3hM\\"
whereas
render()
returns the path in the ordinary form like this:"C:/Users/username/AppData/Local/Temp/RtmpGSN3hM/test_reprex_149c6f644b0d.html"
It seems that RStudio fails to recognize these two are the same.