Skip to content

Commit 20cf773

Browse files
committed
Cleanup docstrings
1 parent 4fb775d commit 20cf773

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

shiny/ui/_markdown_stream.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
StreamingContentType = Literal[
1717
"markdown",
18-
"semi-markdown",
1918
"html",
19+
"semi-markdown",
2020
"text",
2121
]
2222

@@ -42,9 +42,13 @@ class MarkdownStream:
4242
id
4343
A unique identifier for this markdown stream.
4444
content
45-
Initial (starting) content.
45+
Some content to display before any streaming occurs.
4646
content_type
47-
The content type of the markdown content. Default is "markdown".
47+
The content type. Default is "markdown" (specifically, CommonMark).
48+
Other supported options are:
49+
- `"html"`: for rendering HTML content.
50+
- `"text"`: for plain text.
51+
- `"semi-markdown"`: for rendering markdown, but with HTML tags escaped.
4852
4953
Note
5054
----
@@ -88,6 +92,9 @@ def stream(self, content: Iterable[str], clear: bool = True):
8892
8993
Parameters
9094
----------
95+
content
96+
The content to stream. This can be any iterable of strings, such as a list,
97+
generator, or file-like object.
9198
clear
9299
Whether to clear the existing content before streaming the new content.
93100
"""
@@ -145,6 +152,7 @@ def _send_custom_message(self, msg: ContentMessage | isStreamingMessage):
145152
)
146153

147154

155+
@add_example()
148156
def output_markdown_stream(
149157
id: str,
150158
content: str = "",
@@ -161,9 +169,13 @@ def output_markdown_stream(
161169
id
162170
A unique identifier for this markdown stream.
163171
content
164-
Initial (starting) content.
172+
Some content to display before any streaming occurs.
165173
content_type
166-
The content type of the markdown content. Default is "markdown".
174+
The content type. Default is "markdown" (specifically, CommonMark).
175+
Other supported options are:
176+
- `"html"`: for rendering HTML content.
177+
- `"text"`: for plain text.
178+
- `"semi-markdown"`: for rendering markdown, but with HTML tags escaped.
167179
"""
168180
return Tag(
169181
"shiny-markdown-stream",

0 commit comments

Comments
 (0)