gpui-kit GitHub

Components

Markdown builder

A rendered Markdown document.

A builder is RenderOnce. Construct and mount it in one expression.

use gpui_kit::content::Markdown;

Construct

new(ident: impl Into<Ident>, source: impl Into<SharedString>) -> Self

Options

Chain onto the value.

max_lines(lines: usize) -> Self
on_event(handler: impl Fn(&MarkdownEvent, &mut Window, &mut App) + 'static) -> Self
image(source: impl Fn(&ImageRequest, &mut Window, &mut App) -> Option<AnyElement> + 'static) -> Self
highlight(highlighter: impl Fn(&CodeBlock) -> Vec<CodeSpan> + 'static) -> Self

Reports

The variants of the event it emits. It never applies the change itself.

Rendered by

Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.

Source: crates/gpui-kit/src/content/markdown.rs