Skip to main content

Module ui

Module ui 

Source
Expand description

UI rendering helpers for consistent output formatting. The ui module provides functions for formatting error messages and other user-facing output in a consistent and visually appealing way. It is used throughout the CLI application to ensure that all messages are presented in a clear and user-friendly manner.

Functions§

dim
Prints a user-facing message in a dimmed or less prominent style.
error
Prints a user-facing message for an error or failure.
error_prefix
Prints a user-facing message for an error, with a prefix indicating the error type.
format_context_error
Formats an error message with additional context for display to the user, including a colored prefix based on the error kind. This is useful for providing more information about the error, such as where it occurred or what operation was being attempted when the error happened.
format_error
Formats an error message for display to the user, including a colored prefix based on the error kind.
heading
Prints a user-facing message for a title or important section header.
id
Prints a user-facing label for an ID or unique identifier.
info
Prints a user-facing message for informational purposes.
key
Prints a user-facing label for a key or identifier.
newline
Prints a newline to the user-facing output. This can be used to separate sections or add spacing between messages for better readability.
normal
Prints normal text without any special styling. This can be used for messages that don’t fit into the other categories or when you want to reset back to default styling after a heading or label.
path
Prints a user-facing label for a file path or location.
status_bad
Prints a user-facing message for an error status.
status_ok
Prints a user-facing message for a successful status.
status_warn
Prints a user-facing message for a warning status.
subheading
Prints a user-facing message for a subheading or less prominent section header.
success
Prints a user-facing message for a successful operation.
title
Prints a user-facing heading or section title.
underline
Prints a user-facing message with underlined text, often used for emphasis or to indicate a sub-section.
warning
Prints a user-facing message for a warning or recoverable issue.