Benature/obsidian-text-format

Suggestion: You might want to consider "To Title Case"

autonomygaps opened this issue · 3 comments

I was thinking you might want to rename "Capitalize" as "Title Case" and use the gold-standard approach recommended by persnickety folks like John Gruber:
https://individed.com/code/to-title-case/

Capitalize With Confidence
I wrote some Javascript to convert text to title case in response to John Gruber's public call. Smart, properly-cased titles are now yours for the taking.

Developers and Programmers
If you would like to add To Title Case to your own website or app, you can get that code on the Github project page. Just include the JS and add .toTitleCase() to the string you want converted.

To Title Case is used and recommended by the following savvy sites: Daring Fireball

Thank you for your suggestion! I think it is right to rename "Capitalize" as "Title Case", though I am still a bit confused about the difference between the two.

I am a newer to write typescript and I failed to add the npm package in my script, with some error in the Obsidian console like

Plugin failure: obsidian-text-format Error: Cannot find module '@gouch/to-title-case'

(I have run npm i --save-dev @gouch/to-title-case)

I google and refer to StackOverFlow but cannot figure it out. Would you give me some hint of the question or PR? It will be greatly appreciated.

I have no idea how to script this. I'm a consumer, not a producer of these!
I would say: "capitalize" means that every word starts with an uppercase letter; "title case" follows the conventions of leaving certain words in lower case. Hope that helps!

Thank you for your explanation. After a nap, I import the to-title-case script in a workaround method (which is not elegant). Now I add the new command named "Title case", and the "Capitalize" command is kept because I think maybe other users need it.