-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Question]: How to properly add examples so shinylive works properly? #5
Comments
Hey @vedhav - I am sorry for the delay - I totally missed that issue! First of all, there is a new version since you tried it last time - I encourage you to do the update - maybe that resolves some of your issues.
In general, you should not put
I was considering to automatically add
Use decoration as explained above. So for
I even include this example in the documentation.
I know. It's imperfect. If kept 100% then the teal apps (on which I tested) reshuffle elements due to narrow size - that is: encoding, main panel and filter panel in its own row. I tried with keeping 100% and zoom-out a little but it doesn't look well. Ideally, this would be 100% of its parent width + send request to collapse TOC. I was not able to find a way to do this. Maybe you can have a look? :)
You mean to have "Examples" and then "Examples in Shinylive"? |
Closes #5 Here is a screenshot of the reference page with multiple examples. ![screencapture-file-Users-vedha-insightsengineering-teal-modules-general-docs-reference-tm-g-response-html-2024-11-04-20_19_17](https://github.com/user-attachments/assets/3deebd9c-2936-407d-a7a1-d5e58c0895b8)
What is your question?
Based on the readme I tried the following steps:
roxy.shinylive
DESCRIPTION
file withroxygen: list(markdown = TRUE, packages = c("roxy.shinylive"))
@examplesShinylive
tag.Of course I had to run the docs via a static server to make it work so I did that usingI see that this is just an iframe embed so there is no need to serve it.httpuv::runStaticServer(dir = "/Users/vedha/insightsengineering/teal/docs/")
. Would be nice to mention this in the docs so people don't get confused when they don't see this working when opening the static HTML file like they're used to.This had a few small issues with how the examples were written and to make it work I had to make sure that:
library(teal)
was called in the example. Should we have a hook to call the package before running any example?shinyApp()
was run inside theif (interactive())
it did not work unless I changed the if condition to something like thisinteractive() || !is.null(getOption('webr_pkg_repos'))
(not recommending this, I was just testing)140%
seems to overlap and cause layout issues for me. I don't understand why we have this.The final example roxygen code looked like this in my case:
So, I'm looking for a better way to write examples, or add supporting hooks to make it easier to use this package.
Code of Conduct
Contribution Guidelines
The text was updated successfully, but these errors were encountered: