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

shiny prerendered website does not render html according to route #1576

Open
3 tasks done
schloerke opened this issue Apr 29, 2019 · 4 comments
Open
3 tasks done

shiny prerendered website does not render html according to route #1576

schloerke opened this issue Apr 29, 2019 · 4 comments
Labels
feature a feature request or enhancement theme: shiny regarding shiny support in R Markdown document theme: site generator Related to website feature

Comments

@schloerke
Copy link
Contributor

By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.name/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('rmarkdown'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('rstudio/rmarkdown').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

❯❯ xfun::session_info('rmarkdown')
R version 3.5.3 (2019-03-11)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.4

Locale: en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8

Package version:
  base64enc_0.1.3  digest_0.6.18    evaluate_0.13    glue_1.3.1      
  graphics_3.5.3   grDevices_3.5.3  highr_0.8        htmltools_0.3.6 
  jsonlite_1.6     knitr_1.22       magrittr_1.5     markdown_0.9    
  methods_3.5.3    mime_0.6         Rcpp_1.0.1       rmarkdown_1.12.6
  stats_3.5.3      stringi_1.4.3    stringr_1.4.0    tinytex_0.12    
  tools_3.5.3      utils_3.5.3      xfun_0.6         yaml_2.2.0      

Pandoc version: 2.2.1

Community Link: https://community.rstudio.com/t/rmarkdown-website-using-shiny-prerendered-documents/29333

Since rmarkdown::run() targets index.Rmd by default, this is the page that will remain displayed no matter which Rmd file is targeted in the URL.

Reprex Repo: https://github.com/hugo-pa/shiny_website_example

Issue line:

# create shiny app
shiny::shinyApp(
ui = function(req) html,
server = server,
onStart = onStart,
uiPattern = "^/$|^(/.*\\.[Rr][Mm][Dd])$"
)

The line above is returning the original html content for the original shiny prerendered file. This does not adapt to multiple route locations that uiPattern accepts.

I don't know of a direct solution right now as ui, server, and onStart are very connected but separate arguments.

@vnijs
Copy link

vnijs commented Apr 12, 2020

Very interested in this issue. If this can be resolved I assume you then easily embed various learnr documents in a larger Rmarkdown website right?

@hugo-pa In case you haven't found an alternative solution yet ... I created a demo shiny app a few years ago with multiple pages/documents rendered using knitr (link below). Pages can have shiny components, quizzes, etc. and the page only needs to be rendered when you first visit (i.e., no re-rendering). It works well, but perhaps shiny_prerendered could still be faster?

https://github.com/vnijs/shiny-site

@xiangnandang
Copy link

I run into the same issue as @hugo-pa and @schloerke originally elaborated, trying to switch from a working website with runtime:shiny to runtime:shiny_prerendered. Has there been update to resolve this issue? It would be quite nice to use the shiny_prerendered version on multipage website.

@mrworthington
Copy link

Just checking in on the status of this issue. Have run into this a few times now. The prerendered runtime is pretty amazing and would love to be able to include it as part of an entire rmarkdown website.

@cderv cderv added bug an unexpected problem or unintended behavior Enhancement and removed bug an unexpected problem or unintended behavior Enhancement labels Jan 13, 2021
@cderv cderv added feature a feature request or enhancement and removed enhancement labels Apr 14, 2021
@cderv cderv added theme: shiny regarding shiny support in R Markdown document theme: site generator Related to website feature labels Jan 11, 2022
@cderv cderv moved this to Backlog in R Markdown Team Projects Jan 11, 2022
@matthewhirschey
Copy link

Any updates on this? Seems like a whole community of learnr champions are waiting to build amazing learning portals when this is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement theme: shiny regarding shiny support in R Markdown document theme: site generator Related to website feature
Projects
Status: Backlog
Development

No branches or pull requests

6 participants