class

Egui::Markdown

Inherits Egui::Widget < Reference < Object

Constants

CODE_BG = Color32.rgba(240, 241, 243, 255)

Fenced-code background (non-inline blocks; the inline chip is RichLabel::INLINE_CODE_BG).

DEFAULT_BG = Color32.rgba(255, 255, 255, 255)

Default page background — white, a reader page. nil via background: nil disables it (transparent over the panel).

DEFAULT_PAD_X = 10.0

Default horizontal reading padding (the text never touches the window edges); override per widget with pad_x:.

HEADING_SCALES = {2.0, 1.5, 1.15, 1.0, 0.9, 0.85}

HTML-ish heading scale over the style's font size; all bold. h1/h2 are GitHub's 2em/1.5em — 32/24px at the default 16px body.

HR_COLOR = Color32.rgba(209, 217, 224, 179)

Horizontal rule stroke: soft gray, ~70% opacity.

HR_PAD = 5.0

Horizontal rules carry at least this much breathing room above and below the line.

Constructors

new(source : String, base_dir : String | Nil = nil, id : String | Nil = nil, pad_x : Float64 = DEFAULT_PAD_X, background : Color32 | Nil = DEFAULT_BG)
Source

Class methods

parse(source : String) : Array(Block)

Block model of a markdown source. Pure string surgery — the rendering side never re-reads the source.

Source

Instance methods

background

Root relative image paths resolve against (nil = paths stay as written — cwd-relative). Page background behind the rendered blocks (nil = transparent).

Source
background=(background : Color32 | Nil)

Root relative image paths resolve against (nil = paths stay as written — cwd-relative). Page background behind the rendered blocks (nil = transparent).

Source
inspector_label

Short human label for the inspector (the button's text, a label's text…); nil = no meaningful label.

Source
source
Source
style_properties

The stylable properties of THIS widget kind: the StyleVars keys its #ui actually reads, declared here — not hardcoded in the inspector. StyleProps.textlike / .buttonlike provide the common sets. An empty list (the default) means the widget reads no style keys and the inspector shows it as non-stylable.

Source
ui(ui : Ui) : Response
Source

Nested types