Skip to content

Add some guidance to user regarding interactive documents #2564

Open

Description

@cderv

The runtime: shiny vs runtime: shinyrmd distinction is really subtle for someone writing interactive documents.

There are examples where a server.R and ui.Rmd but use runtime: shiny rather than runtime: shinyrmd.

We could add context to rmarkdown::run to understand if the wrong runtime has been specified and guide the user.

Especially:

  • server.R + ui.Rmd should always mean runtime: shinyrmd
  • server: shiny should be used now (instead of runtime: shinyrmd

Adding this note to log and remember this possible improvement.

Activity

  1. added
    theme: shinyregarding shiny support in R Markdown document
    on Jul 24, 2024
  2. vpag commented on Jan 9, 2025

    @vpag

    server: shiny should be used now (instead of runtime: shinyrmd)

    Why should? (Did you mean "server: shiny_prerendered... instead of... shinyrmd", or maybe some deprecations/changes are coming to prerendering-related technique, or smth. else?)

  3. cderv commented on Jan 10, 2025

    @cderv
    CollaboratorAuthor

    I think what I meant was "should recommend" to avoid confusion. And also because on Quarto side, only server: shiny is supported. https://quarto.org/docs/interactive/shiny/

    (Did you mean "server: shiny_prerendered... instead of... shinyrmd"

    No I meant server: shiny. server: shiny_prerendered does not exist. runtime: shiny_prerendered is equivalent to runtime: shinyrmd.

    All this is just several ways to do things. It was introduced through time and can lead to confusion now.

    On rmarkdown side, there is no deprecation. So using runtime: shinyrmd works. However, for document rendered through Quarto, then server: shiny is expected.

    What does not for sure is using server.R + ui.Rmd and not using server: shiny.

    Anyhow, this is documentation improvement mainly.

    No change coming.

  4. vpag commented on Jan 10, 2025

    @vpag

    Ok, so that is for code style, I see.

    With a bit of misunderstanding of "...only server: shiny is supported" -- I've just got the same html-output for both (server: shiny and runtime: shiny_prerendered) variants with quarto render|serve. Also, as per conditions evaluated at is_shiny_prerendered(), seems like all of those fronmatter options are equivalent for Rmd/qmd, if I'm not missing some case.

    And for now, anyway,

    On rmarkdown side, there is no deprecation.
    No change coming.

    Superb. Thanks!

  5. cderv commented on Jan 14, 2025

    @cderv
    CollaboratorAuthor

    I've just got the same html-output for both (server: shiny and runtime: shiny_prerendered) variants with quarto render|serve.

    Internally code is the same. On Quarto side, we do check only for server and not runtime. So some processing or checks on Quarto code can be missed if you use runtime with Quarto. And we don't document it.

    Anyhow, I labelled it documentation issue anyway. Thanks a lot for your question to help us improve!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions