vscode-R icon indicating copy to clipboard operation
vscode-R copied to clipboard

R help viewer doesn't support custom vignette index.html

Open gowerc opened this issue 3 years ago • 1 comments

R packages support the ability for developers to write their own vignette index.html file instead of relying on the one automatically produced by R. If this is opened and viewed with the current help viewer though it just displays the raw html instead of rendering it:

image

To re-produce:

  • Create an R package with a inst/doc/index.html file and a package help file
  • Build & install the package
  • Load the package library(mypackage)
  • Open the package help index file via help(package = "mypackage")
  • Open the vignette index by clicking on the User guides, package vignettes and other documentation. link (see screenshot below for clarity) image

Likewise users can also store arbitrary static html documents in the inst/doc folder which suffer from the same problem with the viewer displaying the raw html code.

Versions

platform       x86_64-apple-darwin17.0     
arch           x86_64                      
os             darwin17.0                  
system         x86_64, darwin17.0          
status                                     
major          4                           
minor          1.3                         
year           2022                        
month          03                          
day            10                          
svn rev        81868                       
language       R                           
version.string R version 4.1.3 (2022-03-10)
nickname       One Push-Up   
Version: 1.65.2
Commit: c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1
Date: 2022-03-10T14:33:49.188Z (2 wks ago)
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 20.6.0

gowerc avatar Mar 29 '22 12:03 gowerc

I tried to reproduce the issue and got the following behaviour:

  • Running help(package = "mypackage") opens the "old" help viewer, which shows the unmodified help page as served by R itself. The title of this window is http://127.0.0.1:[...]/00Index.html. This is not intended, instead the "new" help viewer should open, I'll take a look at how to fix this.
  • Clicking "Help Topics by Package > mypackage > Index" in the R sidebar and then the "User guides, [...]" link works and renders HTML correctly.

Also, the raw HTML in the R Help panel in your screenshot does not have html and body tags, does adding these change anything?

ManuelHentschel avatar Apr 08 '22 15:04 ManuelHentschel

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Apr 09 '23 01:04 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Apr 23 '23 01:04 github-actions[bot]