blockfmt

Function blockfmt 

Source
pub fn blockfmt(content: impl ToString, color: Color) -> String
Expand description

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 with a border as large as possible and centers the content. The resulting cell is colored in the specified color.

ยงExample

use console::Color;
use libpt_cli::printing::blockfmt;
let formatted_content = blockfmt("Hello world!", Color::Blue);
println!("{}", formatted_content);