Expand description
A simple markdown renderer widget for Ratatui.
This module provides a simple markdown renderer widget for Ratatui. It uses the pulldown-cmark
crate to parse markdown and convert it to a Text widget. The Text widget can then be
rendered to the terminal using the ‘Ratatui’ library.
§Features
highlight-code(enabled by default) — Enable syntax highlighting using syntect and ansi-to-tui
§Example
use ratatui::text::Text;
use tui_markdown::from_str;
let markdown = r#"
This is a simple markdown renderer for Ratatui.
- List item 1
- List item 2
```rust
fn main() {
println!("Hello, world!");
}
```
"#;
let text = from_str(markdown);
frame.render_widget(text, frame.area());Structs§
- Default
Style Sheet - The default style set
- Options
- Collection of optional parameters that influence markdown rendering.
Traits§
- Style
Sheet - A collection of
ratatui_core::style::Styles consumed by the renderer.
Functions§
- from_
str - Render Markdown
inputinto a [ratatui::text::Text] using the defaultOptions. - from_
str_ with_ options - Render Markdown
inputinto a [ratatui::text::Text] using the suppliedOptions.