beamtea_help (beamtea v0.1.2)

View Source

A bubble: a help view that renders beamtea_keybind bindings, mirroring the help package in charmbracelet/bubbles.

Two modes: a compact single line (short help) and an expanded multi-column listing (full help). Disabled bindings are omitted automatically.

     H = beamtea_help:new(),
     beamtea_help:short(H, [Up, Down, Quit]),        %% "↑/k up · ↓/j down · q quit"
     beamtea_help:full(H, [[Up, Down], [Quit]]).     %% grouped columns

Summary

Functions

Expanded help from groups (columns) of bindings, one line per binding.

Equivalent to new(#{}).

Options: sep (separator, default " · "), key_color, desc_color.

Compact one-line help from a flat list of bindings.

Render short help when ShowAll is false, full help otherwise. When ShowAll, Bindings must be a list of groups.

Types

model/0

-opaque model()

Functions

full(M, Groups)

-spec full(model(), [[beamtea_keybind:binding()]]) -> iodata().

Expanded help from groups (columns) of bindings, one line per binding.

new()

-spec new() -> model().

Equivalent to new(#{}).

new(Opts)

-spec new(map()) -> model().

Options: sep (separator, default " · "), key_color, desc_color.

short(M, Bindings)

-spec short(model(), [beamtea_keybind:binding()]) -> iodata().

Compact one-line help from a flat list of bindings.

view(M, _, Bindings)

-spec view(model(), boolean(), [term()]) -> iodata().

Render short help when ShowAll is false, full help otherwise. When ShowAll, Bindings must be a list of groups.