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
66
//! A markdown parser and renderer for [egui](https://github.com/emilk/egui).
//!
//! Parses CommonMark markdown into a token stream, then renders it as an interactive
//! egui widget with support for text formatting, links, code blocks, tables, images,
//! blockquotes, lists, and more.
//!
//! # Quick Start
//!
//! ```no_run
//! # use eframe::egui;
//! fn show_markdown(ui: &mut egui::Ui) {
//! let text = "# Hello\n\nThis is **bold** and *italic*.";
//! egui_markdown::MarkdownLabel::new(ui.id().with("md"), text).show(ui);
//! }
//! ```
//!
//! # Feature Flags
//!
//! - `syntax_highlighting` (default) - Syntax-highlighted code blocks via `syntect`.
//! - `images` - Render images inline using `egui_extras` image support.
//! - `svg` - SVG image support.
//!
// TODO: Math/LaTeX support. pulldown-cmark already supports `Options::ENABLE_MATH` which
// emits `InlineMath`/`DisplayMath` events for `$...$` and `$$...$$`. To add math rendering:
// 1. Add a `math` feature flag that enables ENABLE_MATH in the parser.
// 2. Add Token::InlineMath / Token::DisplayMath variants.
// 3. Create a separate `egui_math` crate that takes a LaTeX string and paints it
// using egui's Painter (text for symbols/Greek letters, lines for fraction bars,
// paths for roots, etc.). Use `pulldown-latex` to parse LaTeX into a layout tree.
// 4. Feature-gate the dependency: `math = ["dep:egui_math"]`, delegating to it
// for inline/display math rendering (same pattern as egui_extras for tables).
/// The [`MarkdownLabel`] widget.
/// Layout job construction from token streams.
/// Link handler trait and link styling.
/// Code block and horizontal rule painting.
/// CommonMark markdown parser.
/// Customizable visual styling for markdown rendering.
/// Table rendering.
/// Syntax highlighting theme utilities.
/// Parsed markdown token types.
pub use MarkdownLabel;
pub use CodeThemeArg;
pub use ;
pub use ;
pub use MarkdownStyle;
pub use ;
pub use ;
pub use default_code_theme;