docs(cli::printing): add module documentation
cargo devel CI / cargo CI (push) Successful in 2m0s Details

This commit is contained in:
Christoph J. Scherr 2024-06-27 22:31:36 +02:00
parent 57709e963c
commit 1c78801101
1 changed files with 9 additions and 3 deletions

View File

@ -1,8 +1,14 @@
//! Utilities for formatting, bordering, aligning and printing text content.
//!
//! This module provides functions for formatting content with borders and colors, printing them to the console.
//! The functions in this module are designed to simplify the process of creating visually appealing
//! output for CLI applications.
use comfy_table::presets;
use comfy_table::{CellAlignment, ContentArrangement, Table};
use console::{style, Color};
/// Prints content with a simple border around it.
/// Prints content with a simple border around it
///
/// This function is a convenience wrapper around [blockfmt] and [println]. It automatically
/// formats the content with a border using the specified color and then prints it to the console.
@ -21,7 +27,7 @@ pub fn blockprint(content: impl ToString, color: Color) {
println!("{}", blockfmt(content, color))
}
/// Formats content with a simple border around it.
/// Formats content with a simple border around it
///
/// This function is a convenience wrapper around [blockfmt_advanced] with preset values for
/// border style, content arrangement, and cell alignment. It automatically formats the content
@ -49,7 +55,7 @@ pub fn blockfmt(content: impl ToString, color: Color) -> String {
)
}
/// Formats content with a border around it.
/// Formats content with a border around it
///
/// Unless you are looking for something specific, use [blockfmt] or [blockprint].
///