Skip to content

chore(ui): Deprecate output_text_verbatim() with warning#2097

Open
karangattu wants to merge 9 commits intomainfrom
add-deprecation-warnings-for-output_txt_verbatim
Open

chore(ui): Deprecate output_text_verbatim() with warning#2097
karangattu wants to merge 9 commits intomainfrom
add-deprecation-warnings-for-output_txt_verbatim

Conversation

@karangattu
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.",

Comment thread shiny/ui/_output.py Outdated

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

from .._deprecated import ShinyDeprecationWarning
Copy link
Copy Markdown
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

Comment thread shiny/ui/_output.py
"or `ui.output_code()` if you want to create an output container for code (monospaced text).",
category=ShinyDeprecationWarning,
stacklevel=2,
)
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread shiny/ui/_output.py


@add_example(ex_dir="../api-examples/input_text")
def output_text_verbatim(id: str, placeholder: bool = False) -> Tag:
Copy link
Copy Markdown
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

Comment thread shiny/ui/_output.py Outdated
Copy link
Copy Markdown
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.

Comment thread shiny/ui/_output.py Outdated
Copy link
Copy Markdown
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

Comment thread shiny/ui/_output.py

See Also
--------
* :class:`~shiny.render.text`
Copy link
Copy Markdown
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
Copy Markdown
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.
@karangattu karangattu requested a review from schloerke October 24, 2025 17:32
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