File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
shiny/api-examples/MarkdownStream Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 77
88ui .page_opts (full_width = True )
99
10+ # Initialize a markdown stream object
11+ md = ui .MarkdownStream ("shiny-readme" )
12+
13+ # Display the stream UI in a card
14+ with ui .card (height = "400px" , class_ = "mt-3" , full_screen = True ):
15+ ui .card_header ("Shiny README.md" )
16+ md .ui ()
17+
18+
1019# Read in the README.md file from the py-shiny repository
1120readme = requests .get (
1221 "https://raw.githubusercontent.com/posit-dev/py-shiny/refs/heads/main/README.md"
@@ -22,15 +31,6 @@ async def chunk_generator():
2231 yield chunk + " "
2332
2433
25- md = ui .MarkdownStream ("shiny-readme" )
26-
27- with ui .card (height = "400px" , class_ = "mt-3" , full_screen = True ):
28- ui .card_header ("Shiny README.md" )
29- md .ui ()
30-
31- md .ui (height = 300 )
32-
33-
3434@reactive .effect
3535async def _ ():
3636 await md .stream (chunk_generator ())
You can’t perform that action at this time.
0 commit comments