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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//! [![github]](https://github.com/disco07/rct) [![crates-io]](https://crates.io/crates/rct) [![docs-rs]](https://docs.rs/rct/)
//!
//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
//!
//! <br>
//!
//! #  A CLI Table Output for Rust ๐ฆ projects.
//!
//! ## Usage
//!
//! Add `rct` in your `dependencies` section
//!
//! ```toml
//! [dependencies]
//! rct = "0.2.1"
//! ```
//!
//! ### Basic usage
//! ```rust
//! use rct::cell::ICell;
//! use rct::table::Table;
//!
//! let mut table = Table::new();
//!
//! table
//! .add_header(vec!["ID".cell(), "Title".cell(), "Price โฌ".cell()])
//! .add_row(vec![1.cell(),"Harry \nPotter".cell(), "14.87".cell()])
//! .add_row(vec![2.cell(),"Spider-man".cell(),"18.80".cell()])
//! .add_row(vec![3.cell(), "Avenger".cell(), "18.50".cell()]);
//! table.view();
//!
//! ```
//!
//! ```markdown
//! โโโโโโคโโโโโโโโโโโโโคโโโโโโโโโโ
//! โ ID โ Title โ Price โฌ โ
//! โโโโโโผโโโโโโโโโโโโโผโโโโโโโโโโข
//! โ 1 โ Harry โ 14.87 โ
//! โ โ Potter โ โ
//! โโโโโโผโโโโโโโโโโโโโผโโโโโโโโโโข
//! โ 2 โ Spider-man โ 18.80 โ
//! โโโโโโผโโโโโโโโโโโโโผโโโโโโโโโโข
//! โ 3 โ Avenger โ 18.50 โ
//! โโโโโโงโโโโโโโโโโโโโงโโโโโโโโโโ
//! ```
//!
//! ### Add styles
//! ```
//! use rct::cell::ICell;
//! use rct::table::Table;
//! use rct::styles::color::{Colorizer, Font};
//!
//! let mut table = Table::new();
//!
//! table
//! .add_header(vec!["ID".cell(), "Title".cell(), "Price โฌ".cell()])
//! .add_row(vec![1.cell(),"Harry \nPotter".cell().color("#ff0000"), "14.87".cell()])
//! .add_row(vec![2.cell(),"Spider-man".cell(),"18.80".cell()])
//! .add_row(vec![3.cell(), "Avenger".cell(), "18.50".cell().font(Font::Italic)]);
//! table.view();
//!
//! ```
//! 
//!
//! ### Use derive macro
//! `#[derive(ToTable)]` can be used to display a `Vec` or slice of `struct` as a table.
//! ```rust, no_run
//! use rct::ToTable;
//!
//! #[derive(ToTable)]
//! struct Movies {
//! #[table(rename = "ID")]
//! id: u32,
//! #[table(rename = "Title")]
//! title: String,
//! #[table(rename = "Price โฌ")]
//! price: f32,
//! }
//!
//! let movies = [
//! Movies {
//! id: 1,
//! title: "Harry \nPotter".to_string(),
//! price: 14.87,
//! },
//! Movies {
//! id: 2,
//! title: "Spider-man".to_string(),
//! price: 18.80,
//! },
//! ];
//!
//! let table = movies.into_iter().to_table();
//!
//! println!("{}", table);
//!
//! ```
//!
//! ## Features
//!
//! - `derive`: Enables derive macro for creating tables using structs.
pub use ToTable;
pub use ;