Support title cased field names
Great library! It would be nice to support title case for table headers, i.e., Upper Title Case and lower title case. If a table is primarily intended for a human reader, I think these are the easiest formats to read.
Hi @casey
I do agree with your proposal.
I hope you have noticed,
we already have support for it we just don't support Upper Tittle Case and lower tittle case.
#[derive(Tabled)]
#[tabled(rename_all = "UPPERCASE")]
struct Country {
name: String,
#[tabled(rename_all = "kebab-case")]
area_km2: f32,
}
But I guess it would be also good to provide same functionality dynamically. Like the following.
table.modify(Rows::first(), Format::upper_title_case())
OK I've committed a derive update.
You can use it on master until it not released.
#[derive(Tabled)]
#[tabled(rename_all = "camelCase")]
struct Country {
name: String,
#[tabled(rename_all = "Upper Title Case")]
capital_city: String,
#[tabled(rename_all = "lower title case")]
area_km2: f32,
}
Awesome, just tried out the master branch and it looks great. (It's a tool to enumerate audio devices.)