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>) -> SelfOptions
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) -> SelfReports
The variants of the event it emits. It never applies the change itself.
- LinkClicked
- ImageRequested
- CodeCopied
- MoreRequested
Rendered by
Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.