Support YAML Front Matter for titles and description#35
Merged
AlexJSully merged 5 commits intomainfrom Feb 16, 2026
Merged
Conversation
2 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds YAML front matter support to the Workspace Wiki extension, enabling markdown files to specify custom titles and descriptions that override filename-based defaults. The implementation uses the gray-matter library to parse YAML front matter from markdown files and integrates this functionality throughout the tree building and display pipeline.
Changes:
- Added front matter extraction utilities that parse YAML from markdown files to extract
titleanddescriptionfields - Modified tree building to use front matter titles when available, falling back to normalized filenames
- Updated tree tooltips to display front matter descriptions instead of file paths when available
- Added comprehensive unit tests for front matter parsing with data-driven testing patterns
- Updated configuration files (tsconfig, markdownlint) to support the new functionality and prevent linting conflicts
Reviewed changes
Copilot reviewed 20 out of 22 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/textUtils.ts | Added extractFrontMatter() and extractFrontMatterTitle() functions using gray-matter library; removed unused toSnakeCase() and toCamelCase() functions |
| src/utils/textUtils.test.ts | Added comprehensive unit tests for front matter extraction with table-driven testing patterns; refactored existing tests to use test.each() |
| src/tree/buildTree.ts | Integrated front matter extraction into tree building, using front matter titles when available and attaching descriptions to nodes |
| src/tree/buildTree.test.ts | Updated all buildTree tests to handle async function signature |
| src/tree/treeProvider.ts | Modified tooltip assignment to use front matter description when available, falling back to file path |
| src/tree/treeProvider.test.ts | Updated mock implementations and tests to handle async buildTree function |
| src/types/treeNode.ts | Added optional description field to TreeNode interface for front matter descriptions |
| src/types/workspaceLike.ts | Modified findFiles return type to accommodate test mocks (union with plain objects) |
| tsconfig.json | Added "jest" to types array and removed **/*.test.ts from exclude list to enable test type checking |
| package.json | Added gray-matter dependency (^4.0.3) |
| package-lock.json | Lockfile updates for gray-matter and its dependencies (js-yaml, kind-of, section-matter, etc.) |
| .markdownlint.json | Added MD025 configuration with front_matter_title regex to recognize YAML front matter blocks |
| example/file-types-test/test-md.md | Added example front matter with title and description to demonstrate the feature |
| docs/architecture/utilities.md | Added documentation for YAML front matter support including examples and implementation details |
| docs/architecture/scanner.md | Updated description to clarify scanner doesn't cache metadata or watch for changes |
| docs/usage/testing.md | Added section explaining Jest types are available via tsconfig.json types entry |
| docs/project/index.md | Removed reference to non-existent ROADMAP.md file |
| README.md | Added bullet point highlighting YAML front matter support feature |
| .github/copilot-instructions.md | Added problem-solving philosophy section and test table format documentation |
| src/utils/fileUtils.test.ts | Removed unnecessary jest import (globals available via tsconfig) |
| src/utils/configUtils.test.ts | Removed unnecessary jest import (globals available via tsconfig) |
| src/controllers/previewController.test.ts | Removed unnecessary jest import (globals available via tsconfig) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.