Vale is an open source style & grammar Linter. It enforces style guides and integrates into CI/CD alongside MkDocs and other Static Site Generators.
Resources
Setup
- Install Vale from the Vale GitHub project.
- Create a
.vale.iniconfig file in the root of your MkDocs project:
StylesPath = .vale-styles
# StylesPath → location of custom rules
MinAlertLevel = suggestion
# MinAlertLevel → can be `suggestion`, `warning`, or `error`.
# Directories to lint
[*.{md,markdown}]
BasedOnStyles = Google, write-good
# BasedOnStyles → choose base style guides (Vale ships with Google, Microsoft, write-good, etc.).
- Create a folder
.vale-stylesto add style rules, e.g., a rule to avoid “simply”:
# .vale-styles/Custom/Weasel.yml
extends: existence
message: "Avoid using '%s' — it can weaken your writing."
ignorecase: true
level: warning
tokens:
- simply
- obviously
- clearly
- Run both
mkdocs serveandvale --watch docs/in two terminals to check your docs.--watchmakes Vale continuously lint files and show warnings whenever you save changes. So you have MkDocs hot-reload in one terminal, Vale linting in another. Alternatively use a script to run both commands at once:
mkdocs serve &
vale --watch docs/
waitEditor Integration
- VS Code → The official Vale extension highlights issues inline in your Markdown while typing.
- Notepad++ → No direct Vale plugin, but you could:
- Add a “Run Vale” external tool mapped to a hotkey (
Plugins → NPPExecorRunmenu).- Vale outputs to a console window inside Notepad++, though not inline highlighting.
Style Guides
Vale ships with the following pre-built style guides you can include in your .vale.ini:
write-good→ Based on the classic “write-good” linter (passive voice, weasel words, filler).Google→ Based on the Google Developer Documentation Style Guide.Microsoft→ Based on the Microsoft Writing Style Guide.RedHat→ Based on Red Hat’s style guidelines.IBM→ Based on IBM style rules.proselint→ A prose linter with general grammar & style checks.
Custom Rules
Write rules as .yml files under .vale-styles/, e.g., .vale-styles/STE/ and reference them in valve.ini using BasedOnStyles = STE. If you have a custom style guide you can gradually codify each rule into Vale rules. For example:
- “Don’t use contractions” →
substitutionrule. - “Always use Oxford comma” →
existencerule. - “Avoid jargon” →
substitutionrule with preferred alternatives.