-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Description
It would be pretty cool to see a way to make a format with a macro!
Something Like
let format = table_format!(
// This could be the title format
// C would signify that the cell goes here
Title->{
+===+===+
| C | C |
+===+===+
},
// The Other Formats
Row-> {
+---+---+
| C C |
+---+---+
}
);
// Then to make a table out of it
let mut table = table!(format,
["Hello World!", "This is a cool format tool"]
);
table.set_titles(row!["Cool Title", "Part 2"]);
table.print_tty(true);Which would result in
+==============+============================+
| Cool Title | Part 2 |
+==============+============================+
| Hello World! | This is a cool format tool |
+--------------+----------------------------+
I'm not remotely familiar with how macro writing would work, but would this be possible, I'm happy to work through it, if interested.
Metadata
Metadata
Assignees
Labels
No labels