| Crates.io | to_markdown_table |
| lib.rs | to_markdown_table |
| version | 0.1.5 |
| created_at | 2024-04-01 15:24:04.062774+00 |
| updated_at | 2024-10-06 15:59:36.392752+00 |
| description | An easy way to format any data structure into a Markdown table. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1192663 |
| size | 9,314 |
to_markdown_tableAn easy way to format any data structure into a Markdown table.
[dependencies]
to_markdown_table = "0.1.0"
use to_markdown_table::{MarkdownTable, TableRow};
struct User {
name: String,
age: u32
}
impl Into<TableRow> for User {
fn into(self) -> TableRow {
TableRow::new(vec![self.name.clone(), self.age.to_string()])
}
}
let rows = vec![
User { name: "Jessica".to_string(), age: 28 },
User { name: "Dennis".to_string(), age: 22 }
];
let table = MarkdownTable::new(vec!["Name".to_string(), "Age".to_string()], rows).unwrap();
println!("{}", table);