quarto-ext / shinylive

Quarto extension to embed Shinylive for Python applications
https://quarto-ext.github.io/shinylive/
MIT License
141 stars 7 forks source link

Embedded binary files do not work in `shinylive-r` chunks #40

Open gadenbuie opened 4 months ago

gadenbuie commented 4 months ago

As described in #37, embedded binary files break R-based shinylive chunks. I've modified the example in #37 slightly to demonstrate that using addResourcePath() or relying on the default www/ resource path behavior isn't related to the issue.

This example does work on shinylive.io.

Broken

---
title: "Embed image file attribute shinylive-r"
format: html
filters:
  - shinylive
---

```{shinylive-r}
#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400
## file: app.R
library(shiny)

ui <- fluidPage(
  titlePanel("Hello Shiny!")
)

server <- function(input, output) {

}

# Create Shiny app ----
shinyApp(ui = ui, server = server)

## file: images/basic.txt
## type: binary
SnVzdCBwbGFpbiB0ZXh0Cg==

## Works

````md
---
title: "Embed image file attribute shinylive-r"
format: html
filters:
  - shinylive
---

```{shinylive-r}
#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400
## file: app.R
library(shiny)

ui <- fluidPage(
  titlePanel("Hello Shiny!")
)

server <- function(input, output) {

}

# Create Shiny app ----
shinyApp(ui = ui, server = server)

## file: images/basic.txt
Just plain text