Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
✨ Test code for Textualize/textual#2400
Browse files Browse the repository at this point in the history
  • Loading branch information
davep committed Apr 27, 2023
1 parent cd7e47f commit 92bb83a
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions md_code_blocks.py
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()

0 comments on commit 92bb83a

Please sign in to comment.