Skip to main content

Crate markdown

Crate markdown 

Source
Expand description

boltz-markdown: CommonMark/GFM parsing + rendering primitives.

Layering: this crate must never depend on boltz-ui (see controls.rs module docs) so that boltz-ui can depend on boltz-markdown without creating a dependency cycle.

Modules§

parser

Structs§

BlockQuoteKindColors
Checkbox
A minimal checkbox: a bordered square that renders a checkmark glyph when checked, and invokes on_click (toggling is the caller’s responsibility — this has no internal state, matching every other stateless-config component in this crate) on click.
Copy
Copies the selected text to the clipboard.
CopyAsMarkdown
Copies the selected text as markdown to the clipboard.
CopyButton
A small icon button that copies text to the clipboard on click. No internal “copied” state (that would require this to be a stateful Entity) — callers that want a “copied!” flash can track that externally and swap icon/tooltip.
HeadingLevelStyles
LineCol
Markdown
MarkdownElement
MarkdownFontConfig
Explicit font configuration, passed in by the caller instead of read from a global ThemeSettings (no theme_settings crate exists in this workspace — see module docs above).
MarkdownOptions
MarkdownStyle
ParsedMarkdown
PathWithRange

Enums§

AutoscrollBehavior
CodeBlockRenderer
CopyButtonVisibility
MarkdownFont
ScrollAxes
Which axes a scrollable container should scroll along. Shaped closely enough to ui::ScrollAxes for element.rs/rendered.rs to swap in later, but only wraps gpui’s own overflow_{x,y}_scroll + track_scroll (no custom scrollbar thumb/track rendering: boltz-gpui exposes no primitive lower-level than boltz-ui’s Scrollbars for that, so this is a minimal passthrough fallback).
WrapButtonVisibility

Traits§

WithScrollbar
Minimal WithScrollbar replacement: applies native overflow_scroll + track_scroll for the requested axes. Does not render a visible scrollbar thumb/track (see ScrollAxes docs). Takes a Stateful<Div> (i.e. after .id(...)) because gpui only implements StatefulInteractiveElement (which provides overflow_*_scroll/ track_scroll) for stateful elements, not bare Div.

Functions§

icon_svg
Renders a boltz-icons glyph via gpui::svg() directly — this crate deliberately avoids boltz-ui’s Icon component (see module docs).
simple_tooltip
Builds a .tooltip(...) callback showing text on hover, usable as div().tooltip(simple_tooltip("Copy")).

Type Aliases§

CodeBlockRenderFn
CodeBlockTransformFn
CodeSpanLinkCallback
A callback that can turn inline code span text into a link destination.