Front Matter
Learn how Vale handles front matter.
Front matter is linted in Markdown and its dialects (MDX, MyST, Quarto, R Markdown), AsciiDoc, reStructuredText, Org, Typst, and QDoc files.
There are 3 supported front matter types – YAML, TOML, and JSON. Each is recognized by the delimiters that open and close it:
Opening and closing --- lines:
---
name: "frontmatter"
---
rest of the contentOr an opening ---yaml line with a closing ---:
---yaml
name: "frontmatter"
---
rest of the contentOpening and closing +++ lines:
+++
name = "frontmatter"
+++
rest of the contentOr an opening ---toml line with a closing ---:
---toml
name = "frontmatter"
---
rest of the contentOpening and closing ;;; lines:
Or an opening ---json line with a closing ---:
A bare JSON object followed by an empty line also works:
Each field is dynamically assigned its own scope, allowing you to write rules that target specific ones:
---
title: 'My document'
description: "A short summary of the document's purpose."
author: 'John Doe'
---Using the example above, the generated scopes would be text.frontmatter.title, text.frontmatter.description, and text.frontmatter.author.
A rule can then use these in its scope: field:
This rule would then only be applied to the title field in the front matter.
Only string-valued fields are linted; a list or a nested map is left alone. A field can be excluded by naming its scope in IgnoredScopes.
Last updated