Skip to content

Conversation

karangattu
Copy link
Collaborator

@karangattu karangattu commented Oct 14, 2025

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.
@schloerke schloerke changed the title chore(output_text_verbatim): Deprecate output_text_verbatim with warning chore(ui): Deprecate output_text_verbatim() with warning Oct 16, 2025
Copy link
Collaborator

@schloerke schloerke left a 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

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.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# output_text_verbatim deprecation: https://github.com/posit-dev/py-shiny/pull/2097
"ShinyDeprecationWarning: `ui.output_text_verbatim()` is deprecated.",


from htmltools import Tag, TagAttrValue, TagFunction, css, div, tags

from .._deprecated import ShinyDeprecationWarning
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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,
)
Copy link
Collaborator

@schloerke schloerke Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."
)

Copy link
Collaborator

@schloerke schloerke left a 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:
Copy link
Collaborator

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:

- title: Deprecated

@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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Deprecated. Create a output container for some text.

--------
* :class:`~shiny.render.text`
* :func:`~shiny.ui.output_text`
* :func:`~shiny.ui.output_text_verbatim`
Copy link
Collaborator

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`
Copy link
Collaborator

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

Copy link
Collaborator

@schloerke schloerke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(See comments)

karangattu and others added 4 commits October 16, 2025 21:42
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants