Skip to content

Frontmatter

BobWs edited this page Oct 25, 2026 · 1 revision

📄 Frontmatter

Flatnotes-Enhanced can hide YAML and TOML frontmatter blocks from the rendered note view and preview popup, without modifying the file on disk.

This is useful for notes imported from tools such as Obsidian or Markleaf, where a metadata block at the top of the file clutters the reading experience.


What Is Frontmatter?

Frontmatter is a metadata block placed at the very top of a note, fenced by a repeated delimiter:

YAML — fenced by ---:

---
title: Project kickoff
created: 2026-09-01
tags: [project, meeting]
---

# Project Kickoff

Actual note content starts here.

TOML — fenced by +++:

+++
title = "Project kickoff"
created = "2026-09-01"
+++

# Project Kickoff

Actual note content starts here.

Both formats are supported. The feature only affects the block at the very top of the file; horizontal rules (---) elsewhere in the note are untouched.


Enabling Hide Frontmatter

  1. Go to Settings → Preferences.
  2. Scroll to the “Frontmatter” section.
  3. Toggle “Hide frontmatter in view & preview” ON.
  4. Click Save preferences.

The preference is stored per user in the database.


Behaviour by Scenario

Scenario Result
Toggle ON, note with frontmatter Frontmatter block removed from view and preview
Toggle OFF (default) Frontmatter renders as-is — no change
Toggle ON, note without frontmatter Note renders normally — no change
Toggle ON, note with tags above frontmatter Tags are preserved; frontmatter hidden
Toggle ON, note with horizontal rule (---) later in content Later rule is untouched

What Is Never Affected

  • The file on disk — frontmatter is always preserved. This is a display filter only.
  • The editor — raw Markdown, including frontmatter, is always visible and editable.
  • Other features — tag pills, callouts, task icons, highlights, and tables are unaffected.
  • Horizontal rules below the top block — only the top-of-file frontmatter is stripped.

Where It Applies

The toggle applies to:

  • The note viewer (rendered note view)
  • The note preview popup (eye icon in the sidebar)
  • The editor preview pane

The raw Markdown editor is never modified.


Tags Above Frontmatter

Tags placed above the frontmatter are preserved:

#pin #archived
---
title: Something
---
Note content.

With Hide Frontmatter ON, #pin and #archived continue to function as usual, and the --- block is removed from view. This is important for notes that were archived or pinned before frontmatter was added.


Known Limitation

Collapsible frontmatter is not supported. Obsidian displays frontmatter as a collapsible “▶ Frontmatter” block by default. Flatnotes-Enhanced does not implement that UI; the toggle either shows or hides the block entirely. The hide toggle covers the primary use case for users syncing from external apps.


Typical Workflow: Importing from Obsidian

  1. Import your notes with their existing frontmatter intact.
  2. Go to Settings → Preferences.
  3. Enable “Hide frontmatter in view & preview”.
  4. Open any imported note — the metadata block is hidden from reading view but still visible in the editor.
  5. If you later want to edit metadata, open the note in edit mode; the raw frontmatter is fully editable.

Troubleshooting

Frontmatter Still Visible in View

  • Confirm the toggle is ON in Settings → Preferences.
  • Reload the page (hard refresh with Ctrl+Shift+R) to pick up the saved preference.
  • Confirm the frontmatter block is at the very top of the file — a blank line before --- may prevent detection.

Tags Stopped Working After Hiding Frontmatter

  • Confirm the tags are placed above the frontmatter fence, not inside it.
  • Frontmatter content itself is not parsed for tags.

Editor Shows Frontmatter, View Does Not

  • This is expected. The editor always shows the raw Markdown, including frontmatter. Only the rendered view and preview are filtered.

Horizontal Rule Disappeared

  • Only the top-of-file frontmatter block is stripped. If a --- inside the note appears to be missing, confirm the note does not begin with a valid frontmatter block that was unintentionally interpreted as such.

See Also

Clone this wiki locally