|
| 1 | +--- |
| 2 | +title: Common Case Styles |
| 3 | +h1: Common Uppercase/lowercase Naming Conventions |
| 4 | + |
| 5 | +cases: |
| 6 | +- name: Snake |
| 7 | + example: this_is_a_test |
| 8 | + description: All lower case with underscores |
| 9 | +- name: Screaming snake |
| 10 | + example: THIS_IS_A_TEST |
| 11 | + description: All uppercase with underscores (aka constant) |
| 12 | +- name: Kebab |
| 13 | + example: this-is-a-test |
| 14 | + description: All lower case with hyphens |
| 15 | +- name: Pascal |
| 16 | + example: ThisIsATest |
| 17 | + description: First letter of every word capitalized, spaces removed |
| 18 | +- name: Camel |
| 19 | + example: thisIsATest |
| 20 | + description: First letter of words 2-end capitalized, spaces removed |
| 21 | +- name: Initial Caps |
| 22 | + example: This Is A Test |
| 23 | + description: First letter of every word capitalized, spaces kept |
| 24 | +- name: Sentence |
| 25 | + example: This is a test |
| 26 | + description: First letter of first word capitalized, spaces kept |
| 27 | +- name: Title |
| 28 | + example: This Is a Test |
| 29 | + description: Initial caps for nouns and verbs and ... |
| 30 | + LATER: get exact details |
| 31 | +- name: Upper |
| 32 | + example: THIS IS A TEST |
| 33 | + description: Every letter uppercase |
| 34 | +- name: Lower |
| 35 | + example: this is a test |
| 36 | + description: Every letter lowercase |
| 37 | + |
| 38 | +--- |
| 39 | + |
| 40 | +<table class="mt-2 table table-bordered table-striped"> |
| 41 | + <thead> |
| 42 | + <tr> |
| 43 | + <th>Name</th> |
| 44 | + <th>Example</th> |
| 45 | + <th>Detail</th> |
| 46 | + </tr> |
| 47 | + </thead> |
| 48 | + <tbody> |
| 49 | + {% for case in page.cases %} |
| 50 | + <tr> |
| 51 | + <td>{{case.name}}</td> |
| 52 | + <td><code>{{case.example}}</code></td> |
| 53 | + <td>{{case.description | markdownify | replace: "<p>", "" | replace: "</p>", "" }}</td> |
| 54 | + </tr> |
| 55 | + {% endfor %} |
| 56 | + </tbody> |
| 57 | +</table> |
| 58 | + |
| 59 | +## Links |
| 60 | + |
| 61 | +* [zobweyt/textcase](https://github.com/zobweyt/textcase) - Python |
| 62 | +* [PascalCase regex discussion](https://stackoverflow.com/a/31388507) on StackOverflow |
| 63 | +* [Camel case definition](https://google.github.io/styleguide/javaguide.html#s5.3-camel-case) from Google's Java style guide. |
| 64 | +* [CaseMatcher.kt](https://gist.github.com/SuppieRK/a6fb471cf600271230c8c7e532bdae4b) |
0 commit comments