Markdown¶
Added in version 0.11.0
A widget to display a Markdown document.
- Focusable
- Container
Tip
See MarkdownViewer for a widget that adds additional features such as a Table of Contents.
Example¶
The following example displays Markdown from a string.
from textual.app import App, ComposeResult
from textual.widgets import Markdown
EXAMPLE_MARKDOWN = """\
## Markdown
- Typography *emphasis*, **strong**, `inline code` etc.
- Headers
- Lists
- Syntax highlighted code blocks
- Tables and more
## Quotes
> I must not fear.
> > Fear is the mind-killer.
> > Fear is the little-death that brings total obliteration.
> > I will face my fear.
> > > I will permit it to pass over me and through me.