Skip to main content

Front Matter

Front matter is optional document metadata at the top of a file. Enable it with frontMatter: true on the editor or viewer.

new Editor({
el: root,
frontMatter: true,
});

YAML (default)​

Delimited with ---:

---
title: My Document
author: ToastWrite
tags:
- markdown
- editor
---

# Content starts here

TOML​

Delimited with +++:

+++
title = "My Document"
author = "ToastWrite"
+++

# Content starts here

JSON​

Delimited with { … }:

{
"title": "My Document",
"author": "ToastWrite"
}

# Content starts here

Behavior​

  • Front matter must appear at the very beginning of the document.
  • The parser treats front matter as a distinct block; it is not shown as rendered body content in the preview.
  • Closing delimiters must match the opening format.

Tips​

Front matter is useful for static site generators, CMS metadata, or custom plugins. The raw front matter string is preserved in the Markdown source when you call getMarkdown().