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
//! Convert Markdown into Ratatui [`Text`](ratatui_core::text::Text).
//!
//! [`from_str`] renders with the default styles and options. [`from_str_with_options`] accepts an
//! [`Options`] value for custom [`StyleSheet`] styles and symbols, image fallback mode, and, when
//! the `highlight-code` feature is enabled, syntax-highlighting theme.
//!
//! The returned text may borrow from the Markdown input. It contains terminal text and styles only;
//! image syntax produces a configurable text fallback and does not read or render image resources.
//!
//! # Markdown output
//!
//! Tables use Unicode box-drawing borders, terminal display widths, and the alignment declared by
//! the Markdown delimiter row. Raw HTML stays visible as literal text. Math retains its delimiters,
//! and images render as `[img]` followed by their description or destination.
//!
//! # Syntax highlighting
//!
//! The default `highlight-code` feature highlights fenced code blocks whose language is recognized.
//! It uses `Base16OceanDark` unless [`Options`] selects another [`CodeTheme`]. Themes can come from
//! the built-in set, TextMate source bundled with the application, or a TextMate file read before
//! rendering. Unrecognized code fences use [`StyleSheet::code`] instead.
//!
//! # Example
//!
//! ~~~
//! use ratatui::text::Text;
//! use tui_markdown::from_str;
//!
//! # fn draw(frame: &mut ratatui::Frame) {
//! 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());
//! # }
//! ~~~
pub use crate;
pub use crate;
pub use crate;
pub use crate;