Skip to content

Ensure that your Markdown headings capitalization is correct

License

Notifications You must be signed in to change notification settings

ilyatitovich/remark-lint-heading-capitalization

Repository files navigation

remark-lint-heading-capitalization

remark-lint plugin to ensure that your Markdown headings capitalization is correct.

  1. Capitalize the first word, as well as all nouns, pronouns, verbs, adjectives, and adverbs.
  2. Articles, conjunctions, and prepositions should remain lowercase.
  3. Capitalize the first element in a hyphenated compound. The other elements are generally capitalized unless they are articles, conjunctions, or prepositions.

Some additional points to note:

  • The plugin only checks the first letter of words that require capitalization.
  • Words written in uppercase are automatically skipped by the plugin.

Install

npm install remark-lint-heading-capitalization

Usage

Use like any other remark-lint plugin. Check out the remark-lint documentation for details.

Options

Configuration (TypeScript type).

Fields
  • lowerCaseWords (string[], optional, example: ['die', 'der', 'und']) — extends the default list of lowercase words.

Examples

When this rule is turned on, the following valid.md is ok:

## Where to Ask Questions
## An Apple
## Enable 2FA on GitHub
## Flight-or-Fight

When this rule is turned on, the following invalid.md is not ok:

## Where To Ask questions
## an Apple
## Enable 2FA On GitHub
## Flight-Or-fight
1:1-1:26 warning Heading capitalization error. Expected: 'Where to Ask Questions' found: 'Where To Ask questions' heading-capitalization remark-lint

2:1-2:12 warning Heading capitalization error. Expected: 'An Apple' found: 'an Apple'                             heading-capitalization remark-lint

3:1-3:24 warning Heading capitalization error. Expected: 'Enable 2FA on GitHub' found: 'Enable 2FA On GitHub'     heading-capitalization remark-lint

4:1-4:19 warning Heading capitalization error. Expected: 'Flight-or-Fight' found: 'Flight-Or-fight'               heading-capitalization remark-lint

About

Ensure that your Markdown headings capitalization is correct

Resources

License

Stars

Watchers

Forks