1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
# Markdown
!!! tip "Added in version 0.11.0"
A widget to display a Markdown document.
- [ ] Focusable
- [ ] Container
!!! tip
See [MarkdownViewer](./markdown_viewer.md) for a widget that adds additional features such as a Table of Contents.
## Example
The following example displays Markdown from a string.
=== "Output"
```{.textual path="docs/examples/widgets/markdown.py"}
```
=== "markdown.py"
~~~python
--8<-- "docs/examples/widgets/markdown.py"
~~~
## Reactive Attributes
This widget has no reactive attributes.
## Messages
- [Markdown.TableOfContentsUpdated][textual.widgets.Markdown.TableOfContentsUpdated]
- [Markdown.TableOfContentsSelected][textual.widgets.Markdown.TableOfContentsSelected]
- [Markdown.LinkClicked][textual.widgets.Markdown.LinkClicked]
## Bindings
This widget has no bindings.
## Component Classes
The markdown widget provides the following component classes:
::: textual.widgets.Markdown.COMPONENT_CLASSES
options:
show_root_heading: false
show_root_toc_entry: false
## See Also
* [MarkdownViewer][textual.widgets.MarkdownViewer] code reference
---
::: textual.widgets.Markdown
options:
heading_level: 2
|