Back to @Springer question here: on having more precise title case used in kookma Refnotes plugin and following the APA Style Guide, I started developing a wikitext solution. I would appreciate your input and your simpler solution here.
Trial 1
Giving a title (a sentence), produce the title capitalized according this two rules
- In title case, major words are capitalized, and most minor words are lowercase.
- major words: Nouns, verbs (including linking verbs), adjectives, adverbs, pronouns, and all words of four letters or more are considered major words.
- minor words: Short (i.e., three letters or fewer) conjunctions, short prepositions, and all articles are considered minor words.
\define mytitle() Use it to keep your to-do list, to plan an essay or novel, or to organise your wedding. Record every thought that crosses your brain, or build a flexible and responsive website.
\define punc() . , ? ! ; :
\define major() [split[]]:except[enlist<punc>]:and[join[]length[]compare:number:gt[3]]
<$text text= {{{
[<mytitle>lowercase[]split[ ]first[]titlecase[]]
[<mytitle>lowercase[]split[ ]butfirst[]] :map[filter<major>titlecase[]else<currentTiddler>] :and[join[ ]]
}}} />
Produces:
Use it to Keep Your To-do List, to Plan an Essay or Novel, or to Organise Your Wedding. Record Every Thought That Crosses Your Brain, or Build a Flexible and Responsive Website.
Remarks
-
major
is a filter to check the length of words excluding the punctuation attached to them, if the length is 4 and more, the word considered major and capitalized - The first word is always capitalized, so it is excluded from processing (see first and butfirst filter operator above)
- The
punc
defines punctuations and can be completed
Todos - Need help
The above solution does not meet below requirements for capitalization, so give your solution! Consider simple to understand solutions please!
- the first word of a subtitle
- the first word after a colon, em dash, or end punctuation in a heading
- major words, including the second part of hyphenated major words (e.g., “Self-Report,” not “Self-report”)