ui_formatter#

See UIFormatterMixin.

class zelfred.ui_formatter.UIFormatterMixin[source]#

This mixin class implements helper functions to format terminal output.

format_shortcut(key: str) str[source]#

Format a keyboard shortcut key. By default, the color is magenta. Example:

Enter to open url

format_highlight(text: str) str[source]#

Highlight a text with terminal color. In this project, the color is cyan. Example:

this is a very Important message!

format_key(key: str) str[source]#

Format a key of key-value-pair text with terminal color. In this project, the color is cyan. Example:

tag environment = production

format_value(value: str) str[source]#

Format a value of key-value-pair text with terminal color. In this project, the color is yellow. Example:

tag environment = production

format_key_value(key: str, value: Any) str[source]#

Format a key-value pair text with terminal color. In this project, key is in cyan and value is in yellow. Example:

tag environment = production