-
Notifications
You must be signed in to change notification settings - Fork 43
Add minimal path format syntax reference to imports documentation #2097
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
Conversation
- Add comprehensive section on supported path formats - Document local relative paths, workflowspec format, section references - Document optional imports syntax and deprecated legacy syntax - Add practical examples for each format type - Include combined examples showing multiple formats together - Clarify behavior of path resolution and section extraction Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| **Requirements:** | ||
| - Must have at least 3 parts: `owner/repo/path` | ||
| - Cannot start with `.`, `shared/`, or `/` (these indicate local paths) | ||
| - File is downloaded from GitHub at compile time | ||
|
|
||
| ### 3. Section References | ||
|
|
||
| Import only a specific section from a markdown file: | ||
|
|
||
| ```yaml | ||
| imports: | ||
| - shared/guidelines.md#SecurityNotice | ||
| - githubnext/agentics/docs/best-practices.md@v1.0.0#Testing | ||
| ``` | ||
|
|
||
| **Behavior:** | ||
| - Extracts content from the specified header to the next same-level or higher-level header | ||
| - Supports H1 (`#`), H2 (`##`), and H3 (`###`) headers | ||
| - Section names are case-sensitive | ||
| - Works with both local and remote (workflowspec) paths | ||
|
|
||
| ### 4. Optional Imports | ||
|
|
||
| Mark imports as optional using the `?` modifier (supported in markdown directives only): | ||
|
|
||
| ```markdown | ||
| {{#import? shared/optional-config.md}} | ||
| {{#import? githubnext/agentics/experimental/beta-feature.md@develop}} | ||
| ``` | ||
|
|
||
| **Behavior:** | ||
| - If the file doesn't exist, a friendly informational message is shown | ||
| - Compilation continues without error | ||
| - Useful for environment-specific or conditional configurations | ||
|
|
||
| **Note:** Optional imports are only supported in markdown `{{#import?}}` directives, not in frontmatter `imports:` field. | ||
|
|
||
| ### 5. Deprecated Syntax (Legacy) | ||
|
|
||
| The following syntax is deprecated but still supported: | ||
|
|
||
| ```markdown | ||
| @include shared/file.md | ||
| @import shared/file.md | ||
| @include? shared/optional.md | ||
| ``` | ||
|
|
||
| **Migration:** Use `{{#import}}` instead: | ||
| - `@include path` → `{{#import path}}` | ||
| - `@include? path` → `{{#import? path}}` |
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.
@copilot remove section
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.
Removed the deprecated syntax section in commit 365da41.
Remove the "Deprecated Syntax (Legacy)" section as requested by @pelikhan Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pelikhan
left a comment
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.
@copilot minimize changes, just minimal syntax reference, no examples
Replace verbose examples with minimal path format syntax reference as requested Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Agentic Changeset Generator triggered by this pull request. |
Overview
Updated the imports documentation (
/docs/src/content/docs/reference/imports.md) to add a concise syntax reference for all supported import path formats.Changes
Added Minimal Path Formats Section
The documentation now includes a concise "Path Formats" section with syntax reference for:
shared/,../), and absolute pathsowner/repo/path/file.md[@ref]#SectionName{{#import?}}for optional includesEach format is documented with minimal syntax examples showing the essential patterns without verbose explanations or detailed examples.
Testing
pkg/parser/frontmatter.goandpkg/workflow/imports.goRelated
Closes issue requesting documentation of all supported import path formats.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.