I have a Shiny app running on my own Ubuntu server, it runs flawlessly.
Embedded in my app I also include a learnr tutorial. Both the Shiny app (myapp/
) and the learnr tutorial (mylearnr/
) are inside /srv/shiny-server
.
I call the learnr tutorial from within the Shiny app like this:
# UI side:
htmlOutput("practice")
# Server side:
output$practice <- renderUI({
tags$iframe(
src="https://myserver.com/shiny/mylearnr/",
width="100%", height="100%", frameBorder=0, style="height: 100vh;", scrolling = 'yes'
)
})
The problem with the current set-up is that the learnr tutorial being deployed is always the same. The code above just embeds the current HTML file inside /srv/shiny-server/mylearnr
in the Shiny app.
I tried to make it such that the Shiny app renders a new learnr tutorial each time it runs, like below. But this gives an error, the learnr tutorial is not rendered, and the Shiny app ends up freezing.
# Server side:
output$practice <- renderUI({
rmarkdown::render("/../mylearnr/mylearnr.Rmd") # this did not work
tags$iframe(
src="https://myserver.com/shiny/mylearnr/",
width="100%", height="100%", frameBorder=0, style="height: 100vh;", scrolling = 'yes'
)
})
How can I achieve what I want? Any help appreciated.
Thanks in advance,
bruce