-
Notifications
You must be signed in to change notification settings - Fork 12
Introduce MarkdownDef #3866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce MarkdownDef #3866
Conversation
Preview deployments |
Host Test Results 1 files ± 0 1 suites ±0 3h 13m 22s ⏱️ + 1h 36m 4s For more details on these failures, see this check. Results for commit 1ff2ac5. ± Comparison against base commit 259e584. ♻️ This comment has been updated with latest results. |
17984b6 to
ab8691c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a new MarkdownDef class that extends FileDef to provide specialized handling for markdown files. The implementation extracts metadata (title, excerpt, content) from markdown files and includes a preview component for displaying this information.
Changes:
- Added
MarkdownDefclass for handling markdown files with title and excerpt extraction - Introduced
MarkdownFilePreviewcomponent for rendering markdown file previews - Extended
SerializedFiletype to support generic extra fields - Added
MarkdownSkillexample demonstrating usage ofMarkdownDef
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/base/markdown-file-def.gts |
Core implementation of MarkdownDef with markdown parsing utilities and attribute extraction |
packages/base/markdown-file-preview.gts |
Preview component for displaying markdown file title and excerpt |
packages/base/file-api.gts |
Modified SerializedFile type to accept generic extra fields |
packages/experiments-realm/markdown-skill.gts |
Example Skill that uses MarkdownDef to link to markdown instruction files |
packages/experiments-realm/MarkdownSkill/talk-like-a-pirate.md |
Example markdown file for the MarkdownSkill |
packages/experiments-realm/MarkdownSkill/f9e6e5fa-4c1d-45f2-a1f5-ce8165b9411a.json |
Card instance linking to the example markdown file |
packages/host/tests/acceptance/markdown-file-def-test.gts |
Comprehensive acceptance tests for markdown file extraction and indexing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
faae765 to
23c3ee6
Compare
| return markdown.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); | ||
| } | ||
|
|
||
| function stripMarkdown(text: string): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is interesting--do we also use this function when generating the search doc field value for a card that uses a MarkDownDoc as its field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not currently. Interesting idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i'm wondering if the special markdown text characters might interfere with the querying against a search doc generated from an md file.
ab8691c to
b4c39ca
Compare
- includes an example of usage in MarkdownSkill
23c3ee6 to
fb0325f
Compare
includes an example of usage in MarkdownSkill
Based against Persist pristine file resources and include adoption chain in index #3865 is merged