-
Notifications
You must be signed in to change notification settings - Fork 114
chore(ui): Deprecate output_text_verbatim()
with warning
#2097
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
base: main
Are you sure you want to change the base?
Conversation
Added a deprecation warning to the output_text_verbatim
`ui.output_text_verbatim()` is now deprecated in favor of `ui.output_text()` for text output and `ui.output_code()` for code output. This update adds a deprecation notice to the changelog.
output_text_verbatim()
with warning
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.
Also adjust @render.text
to @render.code
# output_text_verbatim deprecation: https://github.com/posit-dev/py-shiny/pull/2097 | ||
"ShinyDeprecationWarning: `ui.output_text_verbatim()` is deprecated.", |
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.
# output_text_verbatim deprecation: https://github.com/posit-dev/py-shiny/pull/2097 | |
"ShinyDeprecationWarning: `ui.output_text_verbatim()` is deprecated.", |
shiny/ui/_output.py
Outdated
|
||
from htmltools import Tag, TagAttrValue, TagFunction, css, div, tags | ||
|
||
from .._deprecated import ShinyDeprecationWarning |
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.
from .._deprecated import ShinyDeprecationWarning | |
from .._deprecated import warn_deprecated |
"or `ui.output_code()` if you want to create an output container for code (monospaced text).", | ||
category=ShinyDeprecationWarning, | ||
stacklevel=2, | ||
) |
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.
) | |
warn_deprecated( | |
"`ui.output_text_verbatim()` was deprecated in v1.6.0." | |
"Please use `ui.output_text()` / `@render.text` to create an output container for plain text " | |
"or `ui.output_code()` / `@render.code` to create an output container for monospaced text." | |
) |
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.
LGTM given comments / ✅ s
|
||
|
||
@add_example(ex_dir="../api-examples/input_text") | ||
def output_text_verbatim(id: str, placeholder: bool = False) -> Tag: |
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.
Move ui.output_text_verbatim()
to Deprecated section in quartodoc:
py-shiny/docs/_quartodoc-core.yml
Line 368 in 631be6f
- title: Deprecated |
shiny/ui/_output.py
Outdated
@add_example(ex_dir="../api-examples/input_text") | ||
def output_text_verbatim(id: str, placeholder: bool = False) -> Tag: | ||
""" | ||
Create a output container for some text. |
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.
Deprecated. Create a output container for some text. |
shiny/ui/_output.py
Outdated
-------- | ||
* :class:`~shiny.render.text` | ||
* :func:`~shiny.ui.output_text` | ||
* :func:`~shiny.ui.output_text_verbatim` |
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.
Please also adjust any comment to point to shiny.ui.output_code
See Also | ||
-------- | ||
* :class:`~shiny.render.text` |
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.
If appropriate, add shiny.render.code
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.
(See comments)
Replaces @render.text with @render.code in multiple example, test, and template apps to standardize output for monospaced/code-style text. Updates documentation and deprecation warnings to reflect the change, and removes related test error allowances for deprecated output_text_verbatim usage.
Changed the output label from 'Output text verbatim content' to 'Output Code content' in the app and updated the corresponding test to match the new label and output type.
…tps://github.com/posit-dev/py-shiny into add-deprecation-warnings-for-output_txt_verbatim
Added a deprecation warning to the
output_text_verbatim()
output_text_verbatim
withoutput_code
in UI py-shiny-templates#47