Images (static files?) in www/ not served in Positron
#9819
-
|
In Shiny development, it’s a convention to place static files (like images) in a Here’s a reprex. When running the following app, the image referenced by library(shiny)
library(bslib)
ui <- page_sidebar(
title = "My Shiny App",
card(
card_header("Introducing Shiny"),
card_body(
tags$img(src = "logo.png", alt = "Logo"),
"In RStudio, we get both images—the one above and the one below. In
Positron, however, we only get the one below.",
card_image("www/logo.png", alt = "Logo")
),
card_footer("Shiny is a product of Posit.")
)
)
server <- function(input, output) {}
shinyApp(ui = ui, server = server)Screenshots can be found at the bottom.
I would find it quite nice to see images while developing, thus my questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Do you have the Shiny extension installed? We don't currently include it by default, although that is about to change: #1301 If I have the Shiny extension installed and then do Shiny: Run Shiny App (either from the command palette or from the "Run" button on the toolbar, I do see both images:
|
Beta Was this translation helpful? Give feedback.



Do you have the Shiny extension installed? We don't currently include it by default, although that is about to change: #1301
If I have the Shiny extension installed and then do Shiny: Run Shiny App (either from the command palette or from the "Run" button on the toolbar, I do see both images: