Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .claude/commands/review.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Please review the changes I'm about to commit and check:
3. Are any code examples accurate?
4. Is the frontmatter complete and correct?
5. Does the content match our existing style?
6. Are there any links that need testing?
6. Run vale on the files being updated and make a plan to resolve any errors, warnings, and suggestions.
7. Are there any links that need testing?

$ARGUMENTS
31 changes: 31 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Vale configuration for Mintlify documentation

StylesPath = .vale/styles
MinAlertLevel = suggestion
IgnoredScopes = code, tt, img, url, a
SkippedScopes = script, style, pre, figure, code

Packages = Google

Vocab = Mintlify

# This is required since Vale doesn't officially support MDX
[formats]
mdx = md

# MDX support
[*.mdx]
BasedOnStyles = Vale, Google
Vale.Terms = NO # Enforces really harsh capitalization rules, keep off
Vale.Avoid = NO # Too aggressive about common technical terms

# Token and block ignores for MDX-specific syntax
TokenIgnores = (?sm)((?:import|export) .+?$), \
(?<!`)(<\w+ ?.+ ?\/>)(?!`), \
(<[A-Z]\w+>.+?<\/[A-Z]\w+>), \
(<[^>]*>)

BlockIgnores = (?sm)^(<\w+\n .*\s\/>)$, \
(?sm)^({.+.*})

CommentDelimiters = {/*, */}
45 changes: 45 additions & 0 deletions .vale/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Vale Configuration for Mintlify Docs

This directory contains the Vale linting configuration for Mintlify documentation.

## Philosophy

Start simple and grow incrementally as needs emerge. The current setup uses:

- Core Mintlify-specific vocabulary
- Customized rules from the Google developer documentation style guide

## Vale files
- `.vale.ini` - Main configuration file
- `styles/config/vocabularies/Mintlify/` - Mintlify-specific terms
- `styles/Google/` - Google developer documentation style rules customized for Mintlify docs

## When to add vocabulary
- **Mintlify terms** - New components, features, platform-specific concepts
- **Frequent false positives** - Any terms that repeatedly trigger spelling errors, but shouldn't

### Discover new vocabulary
Use the included script to find vocabulary candidates:
```bash
# Discover terms from all files
.vale/scripts/discover-vocabulary.sh

# Discover from specific files
.vale/scripts/discover-vocabulary.sh "components/*.mdx"
```

This script:
1. Runs Vale on specified files
2. Extracts spelling error suggestions
3. Saves results to `.vale/vocabulary-candidates.txt`

## When to add new rules
- **Consistent patterns** - The same style issue appears frequently
- **High-value, low-noise** - Rules that catch problems with minimal false positives

### Testing new rules
Before adding a new rule:
1. Test locally: `vale path/to/file.mdx`
2. Run on sample files: `vale components/*.mdx`
3. Check false positive rate
4. Start with `level: suggestion` then promote to `warning` or `error`
33 changes: 33 additions & 0 deletions .vale/scripts/discover-vocabulary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
# Script to discover potential vocabulary terms from Vale output
# Usage: ./discover-vocabulary.sh [file-pattern]

set -e

PATTERN=${1:-"**/*.mdx"}
OUTPUT_FILE=".vale/vocabulary-candidates.txt"

echo "🔍 Discovering vocabulary candidates from Vale spelling errors..."
echo "Pattern: $PATTERN"
echo ""

# Run Vale and extract spelling error words
vale --no-exit $PATTERN 2>&1 | \
grep "Vale.Spelling" | \
sed -n "s/.*Did you really mean '\([^']*\)'.*/\1/p" | \
sort | uniq -c | sort -nr > "$OUTPUT_FILE"

if [ -s "$OUTPUT_FILE" ]; then
echo "Found vocabulary candidates in $OUTPUT_FILE:"
echo ""
head -20 "$OUTPUT_FILE"
echo ""
echo "Review these terms and add appropriate ones to:"
echo " - .vale/styles/config/vocabularies/Mintlify/accept.txt (if valid)"
echo " - .vale/styles/config/vocabularies/Mintlify/reject.txt (if misspellings)"
echo ""
echo "To clean up this file: rm $OUTPUT_FILE"
else
echo "✅ No vocabulary issues found!"
rm -f "$OUTPUT_FILE"
fi
9 changes: 9 additions & 0 deletions .vale/styles/Google/AMPM.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends: existence
message: "Use 'AM' or 'PM' (preceded by a space)."
link: "https://developers.google.com/style/word-list"
level: error
nonword: true
tokens:
- '\d{1,2}[AP]M\b'
- '\d{1,2} ?[ap]m\b'
- '\d{1,2} ?[aApP]\.[mM]\.'
64 changes: 64 additions & 0 deletions .vale/styles/Google/Acronyms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
extends: conditional
message: "Spell out '%s', if it's unfamiliar to the audience."
link: 'https://developers.google.com/style/abbreviations'
level: suggestion
ignorecase: false
# Ensures that the existence of 'first' implies the existence of 'second'.
first: '\b([A-Z]{3,5})\b'
second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)'
# ... with the exception of these:
exceptions:
- API
- ASP
- CLI
- CPU
- CSS
- CSV
- DEBUG
- DOM
- DPI
- FAQ
- GCC
- GDB
- GET
- GPU
- GTK
- GUI
- HTML
- HTTP
- HTTPS
- IDE
- JAR
- JSON
- JSX
- LESS
- LLDB
- NET
- NOTE
- NVDA
- OSS
- PATH
- PDF
- PHP
- POST
- RAM
- REPL
- RSA
- SCM
- SCSS
- SDK
- SQL
- SSH
- SSL
- SVG
- TBD
- TCP
- TODO
- URI
- URL
- USB
- UTF
- XML
- XSS
- YAML
- ZIP
9 changes: 9 additions & 0 deletions .vale/styles/Google/DateFormat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends: existence
message: "Use 'July 31, 2016' format, not '%s'."
link: 'https://developers.google.com/style/dates-times'
ignorecase: true
level: error
nonword: true
tokens:
- '\d{1,2}(?:\.|/)\d{1,2}(?:\.|/)\d{4}'
- '\d{1,2} (?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)|May|Jun(?:e)|Jul(?:y)|Aug(?:ust)|Sep(?:tember)?|Oct(?:ober)|Nov(?:ember)?|Dec(?:ember)?) \d{4}'
9 changes: 9 additions & 0 deletions .vale/styles/Google/Ellipses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends: existence
message: "In general, don't use an ellipsis."
link: 'https://developers.google.com/style/ellipses'
nonword: true
level: warning
action:
name: remove
tokens:
- '\.\.\.'
13 changes: 13 additions & 0 deletions .vale/styles/Google/EmDash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
extends: existence
message: "Don't put a space before or after an em dash."
link: "https://developers.google.com/style/dashes"
nonword: true
level: error
action:
name: edit
params:
- trim
- " "
tokens:
- '\s[—–]\s'

12 changes: 12 additions & 0 deletions .vale/styles/Google/Exclamation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extends: existence
message: "Don't use exclamation points in text."
link: "https://developers.google.com/style/exclamation-points"
nonword: true
level: warning
action:
name: edit
params:
- trim_right
- "!"
tokens:
- '\w+!(?:\s|$)'
13 changes: 13 additions & 0 deletions .vale/styles/Google/HeadingPunctuation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
extends: existence
message: "Don't put a period at the end of a heading."
link: "https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings"
nonword: true
level: warning
scope: heading
action:
name: edit
params:
- trim_right
- "."
tokens:
- '[a-z0-9][.]\s*$'
42 changes: 42 additions & 0 deletions .vale/styles/Google/Headings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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
exceptions:
- API
- APIs
- CDN
- CORS
- CLI
- Cloudflare
- Cloudflare Worker
- CSS
- DNS
- GitHub
- GitHub App
- GitLab
- HTML
- JavaScript
- JSON
- JWT
- Linux
- macOS
- Mintlify
- MDX
- OAuth
- OpenAPI
- PDF
- SAML
- SDK
- SSL
- SSO
- TLS
- TypeScript
- UI
- UX
- URL
- URLs
- Vercel
- Windows
11 changes: 11 additions & 0 deletions .vale/styles/Google/Latin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends: substitution
message: "Use '%s' instead of '%s'."
link: 'https://developers.google.com/style/abbreviations'
ignorecase: true
level: error
nonword: true
action:
name: replace
swap:
'\b(?:eg|e\.g\.)(?=[\s,;])': for example
'\b(?:ie|i\.e\.)(?=[\s,;])': that is
14 changes: 14 additions & 0 deletions .vale/styles/Google/LyHyphens.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
extends: existence
message: "'%s' doesn't need a hyphen."
link: "https://developers.google.com/style/hyphens"
level: error
ignorecase: false
nonword: true
action:
name: edit
params:
- regex
- "-"
- " "
tokens:
- '\b[^\s-]+ly-\w+\b'
12 changes: 12 additions & 0 deletions .vale/styles/Google/OptionalPlurals.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extends: existence
message: "Don't use plurals in parentheses such as in '%s'."
link: "https://developers.google.com/style/plurals-parentheses"
level: error
nonword: true
action:
name: edit
params:
- trim_right
- "(s)"
tokens:
- '\b\w+\(s\)'
7 changes: 7 additions & 0 deletions .vale/styles/Google/Ordinal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends: existence
message: "Spell out all ordinal numbers ('%s') in text."
link: 'https://developers.google.com/style/numbers'
level: error
nonword: true
tokens:
- \d+(?:st|nd|rd|th)
7 changes: 7 additions & 0 deletions .vale/styles/Google/OxfordComma.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends: existence
message: "Use the Oxford comma in '%s'."
link: 'https://developers.google.com/style/commas'
scope: sentence
level: warning
tokens:
- '(?:[^,]+,){1,}\s\w+\s(?:and|or)'
7 changes: 7 additions & 0 deletions .vale/styles/Google/Parens.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends: existence
message: "Use parentheses judiciously."
link: 'https://developers.google.com/style/parentheses'
nonword: true
level: suggestion
tokens:
- '\(.+\)'
Loading