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

[idea] use Shinylive in pkg docs #1404

Open
pawelru opened this issue Nov 8, 2024 · 5 comments · Fixed by #1472 or #1491 · May be fixed by #1490
Open

[idea] use Shinylive in pkg docs #1404

pawelru opened this issue Nov 8, 2024 · 5 comments · Fixed by #1472 or #1491 · May be fixed by #1490
Assignees
Labels

Comments

@pawelru
Copy link
Contributor

pawelru commented Nov 8, 2024

This is an idea that I would let you refine it better.

I would love to see the documentation (README, vignettes, function reference, etc.) more interactive using Shinylive.

Recently we created a small tool for that purpose roxy.shinylive. Feel free to use it. It's already in the modules packages and I think it's robust enough to be implemented in the core packages.

@vedhav vedhav added the core label Jan 31, 2025
@vedhav vedhav self-assigned this Jan 31, 2025
vedhav added a commit that referenced this issue Feb 4, 2025
Closes #1404 

Note that the shinylive R apps will be broken till the `teal` is
released on CRAN because we are unable to use the dev version of the
packages from pharmaverse.r-universe because the webr binaries build
there are only compatible with the [webr
REPL](https://webr.r-wasm.org/latest/) and not the
[shinylive](https://shinylive.io/r/examples/) yet.
@pawelru
Copy link
Contributor Author

pawelru commented Feb 11, 2025

Hey @vedhav, thanks for the PR. That was a great job. However, I'm still missing shinylive implementation in two places that are important especially for the new comers - it is README and getting started vignette. Would you mind adding this there as well so that we can close it for good? Thanks!

@pawelru pawelru reopened this Feb 11, 2025
@vedhav
Copy link
Contributor

vedhav commented Feb 11, 2025

Sure, I can add it in the getting started vignette. GitHub README does not support iframes as far as I can remember so I don't think it will be possible there.

@pawelru
Copy link
Contributor Author

pawelru commented Feb 11, 2025

I'm typing on the phone so can't check it myself - does markdown support raw html? Maybe this way? Just a thought

@m7pr
Copy link
Contributor

m7pr commented Feb 11, 2025

I would suggest creating README.Rmd file, that has a knitr chunk with below setting:

identical(Sys.getenv("IN_PKGDOWN"), "true")

so it is added only during the PKGDOWN build of docs.

Copied from the other places where we have more options for roxyshinylive.

{r shinylive_iframe_1, echo = FALSE, out.width = '150%', out.extra = 'style = "position: relative; z-index:1"', eval = requireNamespace("roxy.shinylive", quietly = TRUE) && knitr::is_html_output() && identical(Sys.getenv("IN_PKGDOWN"), "true")}

README.Rmd would require a new github automation which renders this file to README.md, each time README.Rmd is changed. Optionally a git hook preventing to change README.md manually. Something similar that we have for rendering documentation.

@pawelru
Copy link
Contributor Author

pawelru commented Feb 11, 2025

Good idea! I was actually thinking about something simpler with hardcoded url (because I would probably not expect changes in the app code) but if you can do this via .Rmd then that would be even better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment