1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
use std::sync::Arc;
use minimo::banner::Banner;
use minimo::*;
use minimo::ask::*;

fn main() {


    Banner::new("minimo").show(yellow_bold);

    // Display a colorful header
    showln!(yellow_bold, "minimo",gray_dim, "VERSION 0.1.0", white,"A minimalistic terminal printing library for Rust");

    // Using showln! macro for colorful text segments
    showln!(gray, "You can use ", magenta, "show!", gray, " or ", yellow, "showln!", gray, " macros");
    showln!(gray, "to print text segments in different colors.\n(Make sure each segment starts with a color)");

    // Using show! and showln! macros with Printable trait
    "You can also use ".show(white_dim);
    "show! ".show(pink);
    "and ".show(purple_bold);
    "showln! ".show(cyan);
    " macros to print random text segments with formatting.".showln(white_dim);

    // Add a colorful divider
    divider_vibrant();



    // Add another colorful divider
    divider_vibrant();

    // Demonstrating text styling
    "Bold and colorful text: ".show(red);
    "Bold".show(bold);
    ", ".show(blink);
    "Italic".show(italic);
    ", and ".show(red);
    "Underlined".showln(underline);

    // Showing usage of vibrant function for colorful characters
    "Vibrant text example: ".vibrant().print();


    // Showing divider and reset line
    divider();
    "Divider above".style(red).print();
    reset_line();
    "Reset line used".show(red);



    // Add dividers with different styles and content
    // divider();
    // divider!();
    // divider!("hello");
    // divider!("-", "hello");
    // divider!("-", "hello", "-");
    // divider!("hello", "-");
    // divider!("-", "hello", "-", "world");

    // // Show a paragraph with a title and wrapped text
    // 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.");


    // //dividers
    // divider!("-", "Hello", "-");
    // divider!("Hello", "-");
    // divider!("-", "Hello");
    // divider!("/", "Hello", "/");

    // Ask for input
    let name = text("What is your name?").unwrap();
    showln!(green, "Hello, ", yellow, name, green, "!");

    // Create a list of choices
    let choices = vec![
        choice!("First choice", "This is the first choice", || {
            println!("First choice selected");
            Ok("First choice selected".into())
        }),
        choice!("Second choice", "This is the second choice", || {
            println!("Second choice selected");
            Ok("Second choice selected".into())
        }),
        choice!("Third choice", "This is the third choice", || {
            println!("Third choice selected");
            Ok("Third choice selected".into())
        }),
    ];

    // Ask for selection
    let selected : Choice<String> = selection!("Select an option", &choices).unwrap();
    showln!(gray, "You selected: ", yellow, selected.name);
    selected.run().unwrap();
}