From ba86904c3887c6ed97ddd2ce0b4a27264d309dda Mon Sep 17 00:00:00 2001 From: Carson Date: Tue, 26 Nov 2024 12:07:58 -0600 Subject: [PATCH] Address review feedback --- shiny/api-examples/MarkdownStream/app-core.py | 3 +-- shiny/ui/__init__.py | 4 ++-- shiny/ui/_markdown_stream.py | 8 ++++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/shiny/api-examples/MarkdownStream/app-core.py b/shiny/api-examples/MarkdownStream/app-core.py index 1096c32a8..ad9770592 100644 --- a/shiny/api-examples/MarkdownStream/app-core.py +++ b/shiny/api-examples/MarkdownStream/app-core.py @@ -5,7 +5,7 @@ from shiny import App, ui app_ui = ui.page_fluid( - ui.markdown_stream_ui("shiny-readme"), + ui.output_markdown_stream("shiny-readme"), ) @@ -23,7 +23,6 @@ def chunk_generator(): yield chunk + " " md = ui.MarkdownStream("shiny-readme") - md.ui() md.stream(chunk_generator()) diff --git a/shiny/ui/__init__.py b/shiny/ui/__init__.py index b3ff2e58b..89a6217f3 100644 --- a/shiny/ui/__init__.py +++ b/shiny/ui/__init__.py @@ -109,7 +109,7 @@ from ._layout import layout_column_wrap from ._layout_columns import layout_columns from ._markdown import markdown -from ._markdown_stream import MarkdownStream, markdown_stream_ui +from ._markdown_stream import MarkdownStream, output_markdown_stream from ._modal import modal, modal_button, modal_remove, modal_show from ._navs import ( nav_control, @@ -274,7 +274,7 @@ # _markdown "markdown", # _markdown_stream - "markdown_stream_ui", + "output_markdown_stream", "MarkdownStream", # _modal "modal_button", diff --git a/shiny/ui/_markdown_stream.py b/shiny/ui/_markdown_stream.py index affcbd7bd..bf0c04ddf 100644 --- a/shiny/ui/_markdown_stream.py +++ b/shiny/ui/_markdown_stream.py @@ -9,7 +9,7 @@ from ._html_deps_py_shiny import markdown_stream_dependency __all__ = ( - "markdown_stream_ui", + "output_markdown_stream", "MarkdownStream", ) @@ -67,7 +67,7 @@ def ui(self) -> Tag: Get the UI element for this markdown stream. This method is only relevant fpr Shiny Express. In Shiny Core, use - :func:`~shiny.ui.markdown_stream_ui` for placing the markdown stream + :func:`~shiny.ui.output_markdown_stream` for placing the markdown stream in the UI. Returns @@ -75,7 +75,7 @@ def ui(self) -> Tag: Tag The UI element for this markdown stream. """ - return markdown_stream_ui(self.id, self._content, self._content_type) + return output_markdown_stream(self.id, self._content, self._content_type) def stream(self, content: Iterable[str], clear: bool = True): """ @@ -143,7 +143,7 @@ def _send_custom_message(self, msg: ContentMessage | isStreamingMessage): ) -def markdown_stream_ui( +def output_markdown_stream( id: str, content: str = "", content_type: StreamingContentType = "markdown",