brick-1.4: A declarative terminal user interface library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Brick.Keybindings.Pretty

Description

This module provides functions for pretty-printing key bindings and for generating Markdown, plain text, and Brick displays of event handler key binding configurations.

Synopsis

Generating help output

keybindingTextTable Source #

Arguments

:: Ord k 
=> KeyConfig k

The key binding configuration in use.

-> [(Text, [KeyEventHandler k m])]

Key event handlers by named section.

-> Text 

Generate a plain text document of sections indicating the key binding state for each event handler.

keybindingMarkdownTable Source #

Arguments

:: Ord k 
=> KeyConfig k

The key binding configuration in use.

-> [(Text, [KeyEventHandler k m])]

Key event handlers by named section.

-> Text 

Generate a Markdown document of sections indicating the key binding state for each event handler.

keybindingHelpWidget Source #

Arguments

:: Ord k 
=> KeyConfig k

The key binding configuration in use.

-> [KeyEventHandler k m]

The list of the event handlers to include in the help display.

-> Widget n 

Build a Widget displaying key binding information for a single related group of event handlers. This is provided for convenience so that basic help text for the application's event handlers can be produced and embedded in the UI.

The resulting widget lists the key events (and keys) bound to the specified handlers, along with the events' names and the list of available key bindings for each handler.

Pretty-printing primitives

ppBinding :: Binding -> Text Source #

Pretty-print a Binding in the same format that is parsed by parseBinding.

ppMaybeBinding :: Maybe Binding -> Text Source #

Pretty-print a Binding in the same format that is parsed by parseBinding; if no binding is given, produce a message indicating no binding.

ppKey :: Key -> Text Source #

Pretty-print a Key in the same format that is parsed by parseBinding.

ppModifier :: Modifier -> Text Source #

Pretty-print a Modifier in the same format that is parsed by parseBinding.

Attributes for Widget rendering

keybindingHelpBaseAttr :: AttrName Source #

The base attribute for Widget keybinding help.

eventNameAttr :: AttrName Source #

The attribute for event names in keybinding help Widgets.

eventDescriptionAttr :: AttrName Source #

The attribute for event descriptions in keybinding help Widgets.

keybindingAttr :: AttrName Source #

The attribute for keybinding lists in keybinding help Widgets.