Add support for Shiny Express in Quarto Dashboards #1212
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for Shiny Express apps in Quarto Dashboards. Prior to this PR, it would throw an error if a Quarto document had an import from
shiny.express.If a code block in a .qmd file has an import from
shiny.express, likefrom shiny.express import ...orimport shiny.express, then the app.py that is generated from the Quarto document will be written in Express syntax instead of Core syntax. Existing Quarto Dashboards with Shiny (which import fromshinyrather thanshiny.express) will continue to work in the existing way, where it writes out an app.py with Core syntax.Remaining issues:
from shiny import reactiveand thenfrom shiny.express import ui, render. Should we have an alias toreactiveinshiny.express?import shinytoimport shiny.express?For example:
This is what it looks like:
The generated
app.pylooks like this.Note that the UI that's generated from the special evaluation of the Express code will not be used. Instead, it will use the UI that was generated by Quarto (in the form of a static .html file). This is done via
app_opts(ui=...).