-
Notifications
You must be signed in to change notification settings - Fork 68
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
Change express.layout
to express.ui
#904
Conversation
d1eb2d8
to
d9361d2
Compare
@wch fwiw #893 addresses that sidebar issue for with ui.sidebar():
...
with ui.nav("Page 1"):
"Page 1 content"
with ui.nav("Page 1"):
"Page 2 content" We still have that (sidebar kwarg) problem for |
49c50f8
to
16d03f2
Compare
06b31e0
to
2f801f7
Compare
I would lean context manager for |
if callable(getattr(res, "tagify", None)): | ||
return res.tagify() # pyright: ignore | ||
if callable(getattr(res, "_repr_html_", None)): | ||
return res._repr_html_() # pyright: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if someday we could ask htmltools if an object is outputtable
* main: (24 commits) Use dynamic version of py-shiny for deploy tests (#970) Add underscores to hide some imports (#978) Add rsconnect json files(shinyapps.io tests) and folium tests (#928) Express' `value_box()` no longer includes named positional args (#966) Include `tooltip()` and `popover()` in express (#949) Remove extra call to run_express() Call `tagify()` early to intercept `AttributeErrors` (#941) Don't pass sidebar twice to navbar_page Update changelog Update changelog Switch from `requests` to `urllib` (#940) Bump version to 0.6.1.1 Fix docstring for page_opts Fix API doc sections for Express Smarter, lazier, and more complete page default/api for express (#893) Change `express.layout` to `express.ui` (#904) Remove `@output` from examples (#790) feat: Allow for `App` `server=` to take `input` only (#920) Add fixes for type stub generation (#828) Move quarto express docs to bottom ...
This PR changes the name of
express.layout
toexpress.ui
, as described in #854 (comment).It also adds a test to make sure that all items from
shiny.ui
are accounted for inshiny.express.ui
, and vice versa. For both of these modules, either a corresponding item must exist in both modules, or it must be listed explicitly in a variable_known_missing
.There are a few remaining API questions:
For some functions, like
card_header()
, it's not clear to me whether they should be context managers or regular functions.shiny.ui.page_navbar()
takes a named argumentsidebar
, which comes after the*args
. Theexpress
version of this function also takes a named argumentsidebar
, but the only way to use it is with something like this, which is really awkward:It would be much better if we could pass in a sidebar object just as a
*arg
, and it would discover it and place it correctly.