chore(ui): Deprecate output_text_verbatim() with warning#2097
Open
karangattu wants to merge 9 commits intomainfrom
Open
chore(ui): Deprecate output_text_verbatim() with warning#2097karangattu wants to merge 9 commits intomainfrom
output_text_verbatim() with warning#2097karangattu wants to merge 9 commits intomainfrom
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
schloerke
requested changes
Oct 16, 2025
Collaborator
schloerke
left a comment
There was a problem hiding this comment.
Also adjust @render.text to @render.code
schloerke
reviewed
Oct 16, 2025
Comment on lines
+94
to
+95
| # output_text_verbatim deprecation: https://github.com/posit-dev/py-shiny/pull/2097 | ||
| "ShinyDeprecationWarning: `ui.output_text_verbatim()` is deprecated.", |
Collaborator
There was a problem hiding this comment.
Suggested change
| # output_text_verbatim deprecation: https://github.com/posit-dev/py-shiny/pull/2097 | |
| "ShinyDeprecationWarning: `ui.output_text_verbatim()` is deprecated.", |
schloerke
reviewed
Oct 16, 2025
|
|
||
| from htmltools import Tag, TagAttrValue, TagFunction, css, div, tags | ||
|
|
||
| from .._deprecated import ShinyDeprecationWarning |
Collaborator
There was a problem hiding this comment.
Suggested change
| from .._deprecated import ShinyDeprecationWarning | |
| from .._deprecated import warn_deprecated |
schloerke
reviewed
Oct 16, 2025
| "or `ui.output_code()` if you want to create an output container for code (monospaced text).", | ||
| category=ShinyDeprecationWarning, | ||
| stacklevel=2, | ||
| ) |
Collaborator
There was a problem hiding this comment.
Suggested change
| ) | |
| 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." | |
| ) |
schloerke
approved these changes
Oct 16, 2025
Collaborator
schloerke
left a comment
There was a problem hiding this comment.
LGTM given comments / ✅ s
schloerke
reviewed
Oct 16, 2025
|
|
||
|
|
||
| @add_example(ex_dir="../api-examples/input_text") | ||
| def output_text_verbatim(id: str, placeholder: bool = False) -> Tag: |
Collaborator
There was a problem hiding this comment.
Move ui.output_text_verbatim() to Deprecated section in quartodoc:
py-shiny/docs/_quartodoc-core.yml
Line 368 in 631be6f
schloerke
reviewed
Oct 16, 2025
Collaborator
There was a problem hiding this comment.
Suggested change
| Deprecated. Create a output container for some text. |
schloerke
reviewed
Oct 16, 2025
Collaborator
There was a problem hiding this comment.
Please also adjust any comment to point to shiny.ui.output_code
schloerke
reviewed
Oct 16, 2025
|
|
||
| See Also | ||
| -------- | ||
| * :class:`~shiny.render.text` |
Collaborator
There was a problem hiding this comment.
If appropriate, add shiny.render.code
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added a deprecation warning to the
output_text_verbatim()output_text_verbatimwithoutput_codein UI py-shiny-templates#47