mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
docs and refactor
This commit is contained in:
28
docs/examples/widgets/markdown.py
Normal file
28
docs/examples/widgets/markdown.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.widgets import Markdown
|
||||
|
||||
EXAMPLE_MARKDOWN = """\
|
||||
# Markdown Document
|
||||
|
||||
This is an example of Textual's `Markdown` widget.
|
||||
|
||||
## Features
|
||||
|
||||
Markdown syntax and extensions are supported.
|
||||
|
||||
- Typography *emphasis*, **strong**, `inline code` etc.
|
||||
- Headers
|
||||
- Lists (bullet and ordered)
|
||||
- Syntax highlighted code blocks
|
||||
- Tables!
|
||||
"""
|
||||
|
||||
|
||||
class MarkdownExampleApp(App):
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Markdown(EXAMPLE_MARKDOWN)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = MarkdownExampleApp()
|
||||
app.run()
|
||||
Reference in New Issue
Block a user