Skip to content
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

Support non-rstudio viewer #449

Closed
renkun-ken opened this issue Dec 23, 2019 · 1 comment
Closed

Support non-rstudio viewer #449

renkun-ken opened this issue Dec 23, 2019 · 1 comment

Comments

@renkun-ken
Copy link

Since vscode-R enables VSCode to show htmlwidgets in a WebView via REditorSupport/vscode-R#150, it should work with most htmlwidgets. However, as reported in REditorSupport/vscode-R#158, kableExtra does not use getOption("viewer") but directly use rstudioapi::isAvailable() and rstudioapi::viewer, which imposes dependency on RStudio viewer.

A better approach is to use getOption("viewer"). In RStudio, it is set to use RStudio Viewer, and in VSCode, it is set to use VSCode WebView, in other cases it is NULL.

@renkun-ken
Copy link
Author

Just saw latest print.kableExtra uses htmltools::html_print which uses getOption("viewer"), and it works with VSCode WebView now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant