Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- keybindingTextTable :: Ord k => KeyConfig k -> [(Text, [KeyEventHandler k m])] -> Text
- keybindingMarkdownTable :: Ord k => KeyConfig k -> [(Text, [KeyEventHandler k m])] -> Text
- keybindingHelpWidget :: Ord k => KeyConfig k -> [KeyEventHandler k m] -> Widget n
- ppBinding :: Binding -> Text
- ppMaybeBinding :: Maybe Binding -> Text
- ppKey :: Key -> Text
- ppModifier :: Modifier -> Text
- keybindingHelpBaseAttr :: AttrName
- eventNameAttr :: AttrName
- eventDescriptionAttr :: AttrName
- keybindingAttr :: AttrName
Generating help output
:: 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 #
:: 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.
:: 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.
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 Widget
s.
eventDescriptionAttr :: AttrName Source #
The attribute for event descriptions in keybinding help Widget
s.
keybindingAttr :: AttrName Source #
The attribute for keybinding lists in keybinding help Widget
s.