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

Exporting interactive rmarkdown notebooks as Shinylive applications #47

Open
luukvdmeer opened this issue Jan 29, 2024 · 2 comments
Open

Comments

@luukvdmeer
Copy link

By adding the runtime: shiny header you can build Shiny apps with RMarkdown documents: https://rmarkdown.rstudio.com/articles_interactive.html

I am wondering if its possible to also export such documents as Shinylive applications. When simply running shinylive::export("myapp", "site") with the myapp directory containing only an .Rmd file with interactive elements, it currently fails since there is neither an app.R nor server.R file present:

Error in shinylive::export("myapp", "site") : 
  Directory myapp does not contain an app.R or server.R file.

In the documentation of the interactive documents linked above it is mentioned that a server.R file is created when running the interactive notebook:

When you run an interactive document, rmarkdown extracts the code in your code chunks and places them into a pseudo server.R file. R Markdown uses the html output of the markdown file as an index.html file to place the reactive elements into.

However, I can't find the location where that file is stored, neither do I know if a "pseudo server.R file" is enough for shinylive.

@luukvdmeer luukvdmeer changed the title Running interactive rmarkdown notebooks Exporting interactive rmarkdown notebooks as Shinylive applications Jan 29, 2024
@schloerke
Copy link
Collaborator

There are no current plans to support Rmarkdown for shinylive. You can use a quarto document with a shinylive cell, but not a server: shiny document.

Example link to quarto document: https://github.com/posit-dev/r-shinylive/blob/52ac800b95961803e35971cef445cd9d26db6239/local/quarto/shinylive.qmd

@schloerke
Copy link
Collaborator

It would be nice to have a server: shinylive (or similar) to have the document be able to be statically exported.

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

2 participants