NameIsKyro56 downloadsKeep YAML tidy by showing, collapsing, or hiding frontmatter.
Tidy YAML is a simple Obsidian community plugin for hiding or collapsing YAML frontmatter without changing note contents.
YAML strip above a note's frontmatter to collapse or expand that file.The plugin works in Source mode, Live Preview, and Reading view. It leaves Obsidian's separate Properties sidebar unchanged.
Every valid leading YAML block has one of three display states:
Hiding remembers whether the file was Shown or Collapsed and restores that state when it is unhidden. File states are saved by vault-relative path, moved when files or folders are renamed, and removed when they are deleted.
The interface deliberately has only two visible controls:
| Control | Scope | Action |
|---|---|---|
| Left-ribbon indicator | Current file | Hide or show YAML; clearly reports visible, hidden, or absent YAML |
YAML strip |
Current file | Collapse or expand YAML |
The strip is a full-width keyboard-accessible button with a clear hover state, focus outline, tooltip, and expanded/collapsed ARIA state.
Open the command palette with Command/Ctrl + P. These six commands are always available and can be assigned hotkeys:
The four all commands set a definite vault state and clear saved file states so every note follows the command. The two current-file commands save only that file's state.
Tidy YAML never edits YAML or Markdown. It uses CodeMirror decorations and view-scoped CSS to change presentation only. Notes with absent, malformed, unclosed, or non-leading YAML are left untouched, and current-file commands show a notice when there is no valid frontmatter.
Shown mode respects Obsidian's Settings → Editor → Properties in document setting. Select Visible or Source there if Obsidian's own Hidden setting prevents frontmatter from appearing. See Obsidian's Properties documentation.
After the plugin is accepted into the Obsidian community directory:
main.js, manifest.json, and styles.css.<vault>/.obsidian/plugins/frontmatter-visibility/.For a local build:
npm ci
npm run build:release
The three ready-to-copy files will be in release/.
The settings page contains only:
Upgrading from 1.x preserves the vault default and valid per-file states. Removed ribbon, status-bar, and editor-chevron settings are discarded automatically.
Node.js 20 or newer is required.
npm ci
npm run dev
| Command | Purpose |
|---|---|
npm run typecheck |
Check TypeScript without emitting files |
npm run lint |
Run ESLint and Obsidian plugin rules |
npm test |
Run the Vitest/JSDOM suite |
npm run build |
Typecheck and create a production main.js |
npm run verify |
Run typecheck, lint, tests, build, and metadata checks |
npm run build:release |
Refresh exactly three files in release/ |
See CONTRIBUTING.md and the manual testing checklist.
Tags must exactly match manifest.json without a v prefix.
npm version patch --no-git-tag-version # or minor / major
# Update CHANGELOG.md before committing the release.
npm run verify
npm run build:release
git add package.json package-lock.json manifest.json versions.json CHANGELOG.md
git commit -m "chore: prepare version 2.1.1"
git tag 2.1.1
git push origin main
git push origin 2.1.1
Replace 2.1.1 with the version produced by the bump. The version lifecycle updates manifest.json and versions.json. A matching tag without a v prefix runs verification and creates a GitHub release containing exactly main.js, manifest.json, and styles.css.
For repository details, commit-message examples, and ready-to-copy 2.1.0 release notes, see GITHUB_RELEASE.md.
For the first Community Plugins submission, publish a GitHub release, then sign in at community.obsidian.md, connect your GitHub account, and add the repository under Plugins → New plugin. Follow the official submission and release requirements.
The plugin works locally, makes no network requests, and never edits frontmatter or note contents. Its data.json stores only the vault display preference and path-based file states.