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

Integrating Quarto in shiny apps #213

Open
davidrsch opened this issue Sep 21, 2024 · 7 comments
Open

Integrating Quarto in shiny apps #213

davidrsch opened this issue Sep 21, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@davidrsch
Copy link

From rstudio/shiny#4123 (comment). I think that adding a function includeQuarto like includeMarkdown is a good idea to make easier to integrate quarto docs inside shinyapps

@cderv
Copy link
Collaborator

cderv commented Sep 24, 2024

cc @gadenbuie as you pointed towards here 😉

We are talking about htmltools::includeMarkdown() which uses markdown package to convert some markdown file to HTML fragement right ?

I do think including a .qmd in a shiny app will require a fragment HTML, right ? Quarto does not have (yet) a rmarkdown::html_fragment() format and format: html would produce a full feature HTML that I don't think can be included in a shiny app.

How both you are seeing this in a shiny app context ?

@cderv cderv added the enhancement New feature or request label Sep 24, 2024
@gadenbuie
Copy link

Quarto does not have (yet) a rmarkdown::html_fragment() format and format: html would produce a full feature HTML that I don't think can be included in a shiny app.

Maybe quarto could render the document and include it in an iframe? Although if Quarto had html fragments, that would also be helpful.

Anyway, I can broadly see the utility of this feature request but I also don't have a good sense of the scope of the feature or how people want to "integrate quarto docs inside shiny apps". My redirection came mostly from knowing that the quarto R package would be a better home for such a feature than shiny.

@cderv
Copy link
Collaborator

cderv commented Sep 24, 2024

Maybe quarto could render the document and include it in an iframe?

This is definitely feasiblAe. Not sure what would be the benefice of making it inside quarto R package. But that is true on both side.

Although if Quarto had html fragments, that would also be helpful.

This is more complex because to make it correctly we would probably need a quarto format for this. Though I can make one specifically in this package by using format: html with custom template.

Problem of fragment is about the feature that would be used for the quarto document. To make them work, we need the head part. We could argue some of them could be available in shiny app already, but this implies both versions should really be in sync. Hope I am clear about my current thinking... 🤔

My redirection came mostly from knowing that the quarto R package would be a better home for such a feature than shiny.

At the end, I guess in the fragment case, I see why it would make sense for it to be in the package. This would be a quarto-r specific current format (like vignette engine).
But for rendering a .qmd and including into shiny app through an iframe, I don't see what makes this package a better place. Though probably there is no better place... (just thinking about testing and problem resolution etc...)

Anyhow, thanks for the feature request @davidrsch. Having more information of context and usage for such feature will help us make it happen. Thanks

@davidrsch
Copy link
Author

I have the idea of this feature while working on an app where I explain certain concepts about machine learning. For the explanation of these concepts I am using quarto docs. Right now I am integrating this into the app by rendering the quarto docs and embedding it's output inside an iframe. The idea of this feature it's to avoid rendering the quarto docs before building or updating the app.

If I change the content of the quarto documents but I do not update the rendered version of them the content displayed won't be updated. So it would be nice to have a way to automatically include the output of quarto render into shiny apps. Right now I am using it with html outputs but I can see this being used also for revealjs presentations and other formats.

@cderv
Copy link
Collaborator

cderv commented Sep 25, 2024

@davidrsch in your case I understand inserting into shinyapps as an iframe is ok, and the pain point is the process for rendering.

If I change the content of the quarto documents but I do not update the rendered version of them the content displayed won't be updated.

I think the .qmd will still need to be rendered at some point. I am not sure how that would work with shiny. Do you want to edit you .qmd and then when running the shiny app, it re-rerender the doc ?

I am trying to get a sense of the use case and how that would work to know which function to add in this package.

@davidrsch
Copy link
Author

This is the idea yes:

Do you want to edit you .qmd and then when running the shiny app, it re-rerender the doc ?

But now I see how there may be some downsides to this like the quarto documents rendering may slow down the app initiation

@cderv
Copy link
Collaborator

cderv commented Sep 26, 2024

the quarto documents rendering may slow down the app initiation

Yes it will I think.

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

No branches or pull requests

3 participants