one/
one.rs

1use std::sync::Arc;
2use minimo::banner::Banner;
3use minimo::*;
4use minimo::ask::*;
5
6fn main() {
7
8
9    Banner::new("minimo").show(yellow_bold);
10
11    // Display a colorful header
12    showln!(yellow_bold, "minimo",gray_dim, "VERSION 0.1.0", white,"A minimalistic terminal printing library for Rust");
13
14    // Using showln! macro for colorful text segments
15    showln!(gray, "You can use ", magenta, "show!", gray, " or ", yellow, "showln!", gray, " macros");
16    showln!(gray, "to print text segments in different colors.\n(Make sure each segment starts with a color)");
17
18    // Using show! and showln! macros with Printable trait
19    "You can also use ".show(white_dim);
20    "show! ".show(pink);
21    "and ".show(purple_bold);
22    "showln! ".show(cyan);
23    " macros to print random text segments with formatting.".showln(white_dim);
24
25    // Add a colorful divider
26    divider_vibrant();
27
28
29
30    // Add another colorful divider
31    divider_vibrant();
32
33    // Demonstrating text styling
34    "Bold and colorful text: ".show(red);
35    "Bold".show(bold);
36    ", ".show(blink);
37    "Italic".show(italic);
38    ", and ".show(red);
39    "Underlined".showln(underline);
40
41    // Showing usage of vibrant function for colorful characters
42    "Vibrant text example: ".vibrant().print();
43
44
45    // Showing divider and reset line
46    divider();
47    "Divider above".style(red).print();
48    reset_line();
49    "Reset line used".show(red);
50
51
52
53    // Add dividers with different styles and content
54    // divider();
55    // divider!();
56    // divider!("hello");
57    // divider!("-", "hello");
58    // divider!("-", "hello", "-");
59    // divider!("hello", "-");
60    // divider!("-", "hello", "-", "world");
61
62    // // Show a paragraph with a title and wrapped text
63    // paragraph!(yellow_bold, "Title", white, "This is a paragraph with a title and long text to see if the content will automatically be wrapped and displayed accordingly.");
64
65
66    // //dividers
67    // divider!("-", "Hello", "-");
68    // divider!("Hello", "-");
69    // divider!("-", "Hello");
70    // divider!("/", "Hello", "/");
71
72    // Ask for input
73    let name = text("What is your name?").unwrap();
74    showln!(green, "Hello, ", yellow, name, green, "!");
75
76    // Create a list of choices
77    let choices = vec![
78        choice!("First choice", "This is the first choice", || {
79            println!("First choice selected");
80            Ok("First choice selected".into())
81        }),
82        choice!("Second choice", "This is the second choice", || {
83            println!("Second choice selected");
84            Ok("Second choice selected".into())
85        }),
86        choice!("Third choice", "This is the third choice", || {
87            println!("Third choice selected");
88            Ok("Third choice selected".into())
89        }),
90    ];
91
92    // Ask for selection
93    let selected : Choice<String> = selection!("Select an option", &choices).unwrap();
94    showln!(gray, "You selected: ", yellow, selected.name);
95    selected.run().unwrap();
96}