errata-ai / Google

A Vale-compatible implementation of the Google Developer Documentation Style Guide.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incomplete rules for Google style in headings

kai687 opened this issue · comments

According to Google:

[...] capitalize only the first word in the title, the first word in a subheading after a colon, and any proper nouns or other terms that are always capitalized a certain way.

# Word: Capitalize

should be a valid heading according to Google style. Currently, this triggers the warnings Google.Colons and Google.Heading.

Changing the scope for Google.Colons fixed that warning, but I have no idea how to change the Google.Heading rule to enforce sentence case, except after colon. I failed to come up with a pattern for the exceptions.

It looks like this can be addressed by the following in Google.Heading

extends: capitalization
message: "'%s' should use sentence-style capitalization."
link: 'https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings'
level: warning
scope: heading
match: $sentence
indicators:
  - ':'

Thank you so much for finding this @ggiesen and taking the time to let me know. This really helps us out.

@kai687

No problem. I actually found the indicators option while digging through the Microsoft style guide. I couldn't find any documentation on it at all in the vale docs.

Would you mind reopening the issue until my PR (#12) is accepted? It will be closed automatically when it is, and the fix will eventually make it into a release.