-
-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Title Case #299
Comments
What's the use-case? The other transformations makes sense for various API conventions, but no APIs use title case AFAIK. |
The use case transforming other formats into title case for data display. For example, Material-UI data grid requires formatting for the column definition: interface CustomGridColDef extends GridColDef {
field: CustomObjectProps;
headerName: TitleCase<CustomObjectProps>;
}
const columns: CustomGridColDef[] = [
{ field: "id", headerName: "Id", flex: 1, minWidth: 150, hide: true },
{ field: "name", headerName: "Name", flex: 1, minWidth: 150 },
{ field: "customProperty", headerName: "Custom Property", flex: 1, minWidth: 150 }
]; Doing something like the above would force the display text to be equivalent to whatever your API returns, but in title case. |
The problem is that "title case" has many variations. It seems like you just want every word to be capitalized, correct? Because "title case" can also mean special rules, like https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case So I think we can add this (just capitalize every word), but it probably needs a better name. (Suggestions welcome) |
Always considered it "song case" because musicians don't care about publishing guidelines. But "title case" is consistent with https://github.com/sindresorhus/titleize |
Nowhere there does it say "title case". Titleize is a different word. |
I think many people call it many different things. If you would like to stick with APA guidelines we can go that route and provide a true "TitleCase" by splitting up the strings and then skipping capitalization on the strings that do not match the APA guidelines. Just to add to the confusion Ruby on Rails calls it "Titleize", but then also aliased it with "TitleCase". @sindresorhus: I wasn't initially sure how difficult it would be to build in the logic to account for english grammar... but I actually just got a working example together for it. However, I kind of like both and I was thinking I could just put both of them in the PR as "TitleCase" and "Titleize"; TitleCase matching the APA guidelines and Titleize being equivalent to capitalizing every letter. This way you could pick and choose which format you like for data display. If you agree, I can put a PR soon. If not, let me know how you would like for me to move forward! |
Would you be open to a PR for Title Case?
Ex.
Upvote & Fund
The text was updated successfully, but these errors were encountered: