# Tidy YAML Tidy YAML is a simple Obsidian community plugin for hiding or collapsing YAML frontmatter without changing note contents. - Click the left-ribbon eye to hide or unhide YAML in the current file. - Click the `YAML` strip above a note's frontmatter to collapse or expand that file. - Use six direct commands for current-file toggles or deterministic vault-wide actions. The plugin works in Source mode, Live Preview, and Reading view. It leaves Obsidian's separate Properties sidebar unchanged. ## How it works Every valid leading YAML block has one of three display states: - **Shown:** YAML is visible and the strip points down. - **Collapsed:** YAML is replaced visually by the strip, which points right. - **Hidden:** Both the YAML and strip are hidden. 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. ## Commands Open the command palette with **Command/Ctrl + P**. These six commands are always available and can be assigned hotkeys: - **Tidy YAML: Hide all** - **Tidy YAML: Show all** - **Tidy YAML: Collapse all** - **Tidy YAML: Expand all** - **Tidy YAML: Collapse/expand this file** - **Tidy YAML: Hide/show this file** 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. ## Source safety 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](https://obsidian.md/help/properties). ## Installation ### Community Plugins After the plugin is accepted into the Obsidian community directory: 1. Open **Settings → Community plugins → Browse**. 2. Search for **Tidy YAML**. 3. Select **Install**, then **Enable**. ### Manual installation 1. Download or build `main.js`, `manifest.json`, and `styles.css`. 2. Create `/.obsidian/plugins/frontmatter-visibility/`. 3. Copy those three files into the new folder. 4. Reload Obsidian and enable **Tidy YAML** under Community plugins. For a local build: ```bash npm ci npm run build:release ``` The three ready-to-copy files will be in `release/`. ## Settings The settings page contains only: - The vault default: Shown, Collapsed, or Hidden. - The number of saved file states and a confirmed reset action. - Obsidian Properties compatibility guidance. Upgrading from 1.x preserves the vault default and valid per-file states. Removed ribbon, status-bar, and editor-chevron settings are discarded automatically. ## Development Node.js 20 or newer is required. ```bash 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](CONTRIBUTING.md) and the [manual testing checklist](docs/manual-testing.md). ## Releasing Tags must exactly match `manifest.json` without a `v` prefix. ```bash 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](GITHUB_RELEASE.md). For the first Community Plugins submission, publish a GitHub release, then sign in at [community.obsidian.md](https://community.obsidian.md), connect your GitHub account, and add the repository under **Plugins → New plugin**. Follow the official [submission and release requirements](https://docs.obsidian.md/plugins/releasing/submit-plugin). ## Privacy and safety 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. ## License [MIT](LICENSE)