to_markdown_table

Crates.ioto_markdown_table
lib.rsto_markdown_table
version
sourcesrc
created_at2024-04-01 15:24:04.062774
updated_at2024-10-06 15:59:36.392752
descriptionAn easy way to format any data structure into a Markdown table.
homepage
repository
max_upload_size
id1192663
Cargo.toml error:TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Jonah Meijers (jonahgoldwastaken)

documentation

README

to_markdown_table

An easy way to format any data structure into a Markdown table.

[dependencies]
to_markdown_table = "0.1.0"

Example

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);
Commit count: 0

cargo fmt