Skip to content

Commit 2faddb5

Browse files
committed
Deprecate output_text_verbatim with warning
Added a deprecation warning to the output_text_verbatim
1 parent 631be6f commit 2faddb5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

shiny/ui/_output.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
"output_ui",
1111
)
1212

13+
import warnings
1314
from typing import Optional
1415

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

18+
from .._deprecated import ShinyDeprecationWarning
1719
from .._docstring import add_example, no_example
1820
from ..module import resolve_id
1921
from ..types import MISSING, MISSING_TYPE
@@ -346,6 +348,14 @@ def output_text_verbatim(id: str, placeholder: bool = False) -> Tag:
346348
See :func:`~shiny.ui.output_text`
347349
"""
348350

351+
warnings.warn(
352+
"`ui.output_text_verbatim()` is deprecated. "
353+
"Please use `ui.output_text()` if you want to create an output container for some text, "
354+
"or `ui.output_code()` if you want to create an output container for code (monospaced text).",
355+
category=ShinyDeprecationWarning,
356+
stacklevel=2,
357+
)
358+
349359
cls = "shiny-text-output" + (" noplaceholder" if not placeholder else "")
350360
return tags.pre(id=resolve_id(id), class_=cls)
351361

0 commit comments

Comments
 (0)