This repository has been archived by the owner on Jun 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Test code for Textualize/textual#2400
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""https://github.com/Textualize/textual/issues/2400""" | ||
|
||
from textual.app import App, ComposeResult | ||
from textual.containers import VerticalScroll | ||
from textual.widgets import Header, Footer, Markdown | ||
|
||
MARKDOWN = """\ | ||
# Hello world! | ||
Here is some Python code in a code block: | ||
```python | ||
def hello() -> str: | ||
return "Hello!" | ||
``` | ||
Here is some plain text in a code block: | ||
``` | ||
Hello! | ||
``` | ||
""" | ||
class MDCodeBlocksApp( App[ None ] ): | ||
|
||
def compose( self ) -> ComposeResult: | ||
yield Header() | ||
with VerticalScroll(): | ||
yield Markdown( MARKDOWN ) | ||
yield Footer() | ||
|
||
def on_mount( self ) -> None: | ||
self.dark = True | ||
|
||
if __name__ == "__main__": | ||
MDCodeBlocksApp().run() |