Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsievert committed Nov 26, 2024
1 parent 9fbfb2e commit ba86904
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions shiny/api-examples/MarkdownStream/app-core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
)


Expand All @@ -23,7 +23,6 @@ def chunk_generator():
yield chunk + " "

md = ui.MarkdownStream("shiny-readme")
md.ui()
md.stream(chunk_generator())


Expand Down
4 changes: 2 additions & 2 deletions shiny/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -274,7 +274,7 @@
# _markdown
"markdown",
# _markdown_stream
"markdown_stream_ui",
"output_markdown_stream",
"MarkdownStream",
# _modal
"modal_button",
Expand Down
8 changes: 4 additions & 4 deletions shiny/ui/_markdown_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ._html_deps_py_shiny import markdown_stream_dependency

__all__ = (
"markdown_stream_ui",
"output_markdown_stream",
"MarkdownStream",
)

Expand Down Expand Up @@ -67,15 +67,15 @@ 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
-------
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):
"""
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit ba86904

Please sign in to comment.