Skip to content

Commit d72c464

Browse files
committed
docs: added docs about config imports
1 parent 786f86d commit d72c464

File tree

2 files changed

+60
-7
lines changed

2 files changed

+60
-7
lines changed

docs/configuration.md

+52-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Configuration is built around three core concepts:
1313
- Composer package
1414
- or Git diffs
1515
- **Modifiers**: Transform source content before inclusion - clean up, simplify, or enhance raw content
16+
- **Imports**: Include and merge configuration from external files to enable modular configuration management
1617

1718
## YAML Configuration Format
1819

@@ -106,4 +107,54 @@ Create a `context.json` file in your project root:
106107
}
107108
```
108109

109-
As you can see it's pretty simple.
110+
As you can see it's pretty simple.
111+
112+
## Configuration Imports
113+
114+
For large projects with multiple components or services, you can split your configuration across multiple files using the import functionality.
115+
116+
- Import paths are resolved relative to the importing file
117+
- You can apply path prefixes to source paths in imported configurations
118+
- Imports can be nested (configurations can import other configurations)
119+
- Circular imports are automatically detected and prevented
120+
121+
### Import Example in YAML
122+
123+
```yaml
124+
import:
125+
- path: services/api/context.yaml
126+
127+
documents:
128+
- description: Project Overview
129+
outputPath: docs/overview.md
130+
sources:
131+
- type: text
132+
content: |
133+
# Project Documentation
134+
135+
This is the main project documentation.
136+
```
137+
138+
### Import Example in JSON
139+
140+
```json
141+
{
142+
"import": [
143+
{
144+
"path": "services/api/context.json"
145+
}
146+
],
147+
"documents": [
148+
{
149+
"description": "Project Overview",
150+
"outputPath": "docs/overview.md",
151+
"sources": [
152+
{
153+
"type": "text",
154+
"content": "# Project Documentation\n\nThis is the main project documentation."
155+
}
156+
]
157+
}
158+
]
159+
}
160+
```

docs/quick-start.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,14 @@ name from the `src/Models` directory.
5555

5656
#### Need more advanced configuration?
5757

58-
- Learn about [Document Structure](/documents) and properties
59-
- Explore different source types like [GitHub](/sources/github-source), [Git Diff](/sources/git-diff-source),
60-
or [URL](/sources/url-source)
61-
- Apply [Modifiers](/modifiers) to transform your content (like extracting PHP signatures)
62-
- Discover how to use [Environment Variables](/environment-variables) in your config
63-
- Use [IDE Integration](/getting-started/ide-integration) for autocompletion and validation
58+
- Learn about [Configuration formats and imports](/configuration) to understand available syntax options (YAML or JSON)
59+
and how to organize your setup with modular imports.
60+
- Learn about [Document Structure](/documents) and properties
61+
- Explore different source types like [GitHub](/sources/github-source), [Git Diff](/sources/git-diff-source),
62+
or [URL](/sources/url-source)
63+
- Apply [Modifiers](/modifiers) to transform your content (like extracting PHP signatures)
64+
- Discover how to use [Environment Variables](/environment-variables) in your config
65+
- Use [IDE Integration](/getting-started/ide-integration) for autocompletion and validation
6466

6567
## 4. Build the Context
6668

0 commit comments

Comments
 (0)