Skip to content

Edit YAML frontmatter from the preview#194

Open
daniel-grabowski wants to merge 2 commits into
alecdotdev:masterfrom
daniel-grabowski:pr/frontmatter-editor
Open

Edit YAML frontmatter from the preview#194
daniel-grabowski wants to merge 2 commits into
alecdotdev:masterfrom
daniel-grabowski:pr/frontmatter-editor

Conversation

@daniel-grabowski

Copy link
Copy Markdown
Contributor

Summary

  • render YAML frontmatter as a collapsed properties panel before the Markdown body
  • let scalar values be edited inline and list values such as keywords be edited as tags
  • keep invalid frontmatter out of the rendered body while showing the YAML parser error
  • add a local test:frontmatter script for parser, disclosure, and tag-editing coverage

Notes

This adds the yaml runtime dependency for parsing and serializing frontmatter, plus tsx as a dev-only runner for the new TypeScript tests.

Testing

  • npm run test:frontmatter
  • npm run check (passes with 0 errors; existing warnings remain in Settings, TitleBar, and ZoomOverlay)
  • npm run build (passes; existing Vite/Svelte warnings remain)
  • git diff --check

Render YAML frontmatter as a collapsed properties panel before the Markdown body instead of sending it through Markdown rendering. Scalar fields can be edited inline, and list fields such as keywords can be managed as tags.

Add parser and update helpers backed by yaml, preserve document line endings when metadata is written, and keep invalid frontmatter out of the rendered body while surfacing the parser error.

Add test:frontmatter coverage for parsing, CRLF preservation, invalid YAML, collapsed disclosure behavior, and tag editing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant