Skip to content

Commit 786f86d

Browse files
committed
docs: added docs about tree view config
1 parent f51ba13 commit 786f86d

File tree

2 files changed

+168
-32
lines changed

2 files changed

+168
-32
lines changed

docs/sources/composer-source.md

Lines changed: 84 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,20 @@ documents:
2020
2121
## Parameters
2222
23-
| Parameter | Type | Default | Description |
24-
|----------------|---------------|-----------------------|------------------------------------------------------------|
25-
| `type` | string | required | Must be `"composer"` |
26-
| `description` | string | `"Composer Packages"` | Human-readable description of the source |
27-
| `composerPath` | string | `"."` | Path to composer.json file or directory containing it |
28-
| `packages` | string\|array | `[]` | Package name pattern(s) to match |
29-
| `filePattern` | string\|array | `"*.php"` | File pattern(s) to match |
30-
| `notPath` | array | `["tests", "vendor"]` | Patterns to exclude files |
31-
| `path` | string\|array | `[]` | Patterns to include only files in specific paths |
32-
| `contains` | string\|array | `[]` | Patterns to include only files containing specific content |
33-
| `notContains` | string\|array | `[]` | Patterns to exclude files containing specific content |
34-
| `showTreeView` | boolean | `true` | Whether to display a package tree visualization |
35-
| `modifiers` | array | `[]` | Content modifiers to apply |
23+
| Parameter | Type | Default | Description |
24+
|----------------|-----------------|-----------------------|----------------------------------------------------------------------------------------|
25+
| `type` | string | required | Must be `"composer"` |
26+
| `description` | string | `"Composer Packages"` | Human-readable description of the source |
27+
| `composerPath` | string | `"."` | Path to composer.json file or directory containing it |
28+
| `packages` | string\|array | `[]` | Package name pattern(s) to match |
29+
| `filePattern` | string\|array | `"*.php"` | File pattern(s) to match |
30+
| `notPath` | array | `["tests", "vendor"]` | Patterns to exclude files |
31+
| `path` | string\|array | `[]` | Patterns to include only files in specific paths |
32+
| `contains` | string\|array | `[]` | Patterns to include only files containing specific content |
33+
| `notContains` | string\|array | `[]` | Patterns to exclude files containing specific content |
34+
| `showTreeView` | boolean | `true` | Whether to display a directory tree visualization (deprecated, use `treeView` instead) |
35+
| `treeView` | boolean\|object | `true` | Tree view configuration, can be a boolean or detailed configuration object |
36+
| `modifiers` | array | `[]` | Content modifiers to apply |
3637

3738
## Basic Usage
3839

@@ -72,7 +73,76 @@ documents:
7273
- vendor
7374
contains: class
7475
notContains: @deprecated
75-
showTreeView: true
7676
modifiers:
7777
- php-signature
78+
```
79+
80+
## Tree View Configuration
81+
82+
You can customize the tree view with detailed configuration options:
83+
84+
```yaml
85+
documents:
86+
- description: Filtered Composer Dependencies
87+
outputPath: docs/filtered-deps.md
88+
sources:
89+
- type: composer
90+
description: Filtered Dependencies
91+
composerPath: .
92+
packages:
93+
- symfony/console
94+
- symfony/http-foundation
95+
treeView:
96+
enabled: true
97+
showSize: true
98+
showLastModified: true
99+
showCharCount: true
100+
includeFiles: true
101+
maxDepth: 3
102+
dirContext:
103+
"src/Controller": "Application controllers"
104+
"src/Models": "Domain models and entities"
105+
```
106+
107+
### Tree View Options
108+
109+
| Option | Type | Default | Description |
110+
|--------------------|---------|---------|------------------------------------------------------------------|
111+
| `enabled` | boolean | `true` | Whether to show the tree view |
112+
| `showSize` | boolean | `false` | Include file/directory sizes in the tree |
113+
| `showLastModified` | boolean | `false` | Include last modified dates in the tree |
114+
| `showCharCount` | boolean | `false` | Include character counts in the tree |
115+
| `includeFiles` | boolean | `true` | Whether to include files (true) or only show directories (false) |
116+
| `maxDepth` | integer | `0` | Maximum depth of the tree to display (0 for unlimited) |
117+
| `dirContext` | object | `{}` | Optional descriptions for specific directories |
118+
119+
Example output with enhanced tree view:
120+
121+
```
122+
Project
123+
├── src/ [4.2 MB, 2024-03-12, 25,483 chars]
124+
│ ├── Controller/ [756 KB, 2024-03-10, 7,521 chars] # Application controllers
125+
│ │ ├── ApiController.php [328 KB, 2024-03-10, 3,845 chars]
126+
│ │ └── WebController.php [428 KB, 2024-03-05, 3,676 chars]
127+
│ ├── Models/ [1.2 MB, 2024-03-12, 12,345 chars] # Domain models and entities
128+
│ │ ├── User.php [128 KB, 2024-03-05, 1,234 chars]
129+
│ │ └── Product.php [96 KB, 2024-03-12, 987 chars]
130+
```
131+
132+
### Simple Boolean Usage
133+
134+
For backward compatibility, you can still use a boolean value:
135+
136+
```yaml
137+
documents:
138+
- description: Filtered Composer Dependencies
139+
outputPath: docs/filtered-deps.md
140+
sources:
141+
- type: composer
142+
description: Filtered Dependencies
143+
composerPath: .
144+
packages:
145+
- symfony/console
146+
- symfony/http-foundation
147+
treeView: false # Disable tree view
78148
```

docs/sources/file-source.md

Lines changed: 84 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,28 @@ documents:
1515
sourcePaths: src
1616
filePattern: "*.php"
1717
notPath: [ "tests", "vendor" ]
18-
showTreeView: true
1918
modifiers: [ "php-signature" ]
2019
```
2120
2221
## Parameters
2322
24-
| Parameter | Type | Default | Description |
25-
|----------------------------------|---------------|----------|--------------------------------------------------------------------------|
26-
| `type` | string | required | Must be `"file"` |
27-
| `description` | string | `""` | Human-readable description of the source |
28-
| `sourcePaths` | string\|array | required | Path(s) to directory or files to include |
29-
| `filePattern` | string\|array | `"*.*"` | File pattern(s) to match |
30-
| `notPath` (or `excludePatterns`) | array | `[]` | Patterns to exclude files |
31-
| `path` | string\|array | `[]` | Patterns to include only files in specific paths |
32-
| `contains` | string\|array | `[]` | Patterns to include only files containing specific content |
33-
| `notContains` | string\|array | `[]` | Patterns to exclude files containing specific content |
34-
| `size` | string\|array | `[]` | Size constraints for files (e.g., `"> 10K"`, `"< 1M"`) |
35-
| `date` | string\|array | `[]` | Date constraints for files (e.g., `"since yesterday"`, `"> 2023-01-01"`) |
36-
| `ignoreUnreadableDirs` | boolean | `false` | Whether to ignore unreadable directories |
37-
| `showTreeView` | boolean | `true` | Whether to display a directory tree visualization |
38-
| `modifiers` | array | `[]` | Content modifiers to apply |
39-
| `tags` | array | [] | List of tags for this source |
23+
| Parameter | Type | Default | Description |
24+
|----------------------------------|-----------------|----------|----------------------------------------------------------------------------------------|
25+
| `type` | string | required | Must be `"file"` |
26+
| `description` | string | `""` | Human-readable description of the source |
27+
| `sourcePaths` | string\|array | required | Path(s) to directory or files to include |
28+
| `filePattern` | string\|array | `"*.*"` | File pattern(s) to match |
29+
| `notPath` (or `excludePatterns`) | array | `[]` | Patterns to exclude files |
30+
| `path` | string\|array | `[]` | Patterns to include only files in specific paths |
31+
| `contains` | string\|array | `[]` | Patterns to include only files containing specific content |
32+
| `notContains` | string\|array | `[]` | Patterns to exclude files containing specific content |
33+
| `size` | string\|array | `[]` | Size constraints for files (e.g., `"> 10K"`, `"< 1M"`) |
34+
| `date` | string\|array | `[]` | Date constraints for files (e.g., `"since yesterday"`, `"> 2023-01-01"`) |
35+
| `ignoreUnreadableDirs` | boolean | `false` | Whether to ignore unreadable directories |
36+
| `showTreeView` | boolean | `true` | Whether to display a directory tree visualization (deprecated, use `treeView` instead) |
37+
| `treeView` | boolean\|object | `true` | Tree view configuration, can be a boolean or detailed configuration object |
38+
| `modifiers` | array | `[]` | Content modifiers to apply |
39+
| `tags` | array | [] | List of tags for this source |
4040

4141
## Multiple Source Paths
4242

@@ -248,4 +248,70 @@ This will:
248248
6. Only include files modified in the last month
249249
7. Skip directories that can't be read due to permissions
250250
8. Show a directory tree in the output
251-
9. Apply the PHP signature modifier to simplify method implementations
251+
9. Apply the PHP signature modifier to simplify method implementations
252+
253+
## Tree View Configuration
254+
255+
You can customize the tree view with detailed configuration options:
256+
257+
```yaml
258+
documents:
259+
- description: "Enhanced Tree View Example"
260+
outputPath: "docs/enhanced-tree.md"
261+
sources:
262+
- type: file
263+
description: "Files with Enhanced Tree View"
264+
sourcePaths: src
265+
filePattern: "*.php"
266+
treeView:
267+
enabled: true
268+
showSize: true
269+
showLastModified: true
270+
showCharCount: true
271+
includeFiles: true
272+
maxDepth: 3
273+
dirContext:
274+
"src/Controller": "Application controllers"
275+
"src/Models": "Domain models and entities"
276+
```
277+
278+
### Tree View Options
279+
280+
| Option | Type | Default | Description |
281+
|--------------------|---------|---------|------------------------------------------------------------------|
282+
| `enabled` | boolean | `true` | Whether to show the tree view |
283+
| `showSize` | boolean | `false` | Include file/directory sizes in the tree |
284+
| `showLastModified` | boolean | `false` | Include last modified dates in the tree |
285+
| `showCharCount` | boolean | `false` | Include character counts in the tree |
286+
| `includeFiles` | boolean | `true` | Whether to include files (true) or only show directories (false) |
287+
| `maxDepth` | integer | `0` | Maximum depth of the tree to display (0 for unlimited) |
288+
| `dirContext` | object | `{}` | Optional descriptions for specific directories |
289+
290+
Example output with enhanced tree view:
291+
292+
```
293+
Project
294+
├── src/ [4.2 MB, 2024-03-12, 25,483 chars]
295+
│ ├── Controller/ [756 KB, 2024-03-10, 7,521 chars] # Application controllers
296+
│ │ ├── ApiController.php [328 KB, 2024-03-10, 3,845 chars]
297+
│ │ └── WebController.php [428 KB, 2024-03-05, 3,676 chars]
298+
│ ├── Models/ [1.2 MB, 2024-03-12, 12,345 chars] # Domain models and entities
299+
│ │ ├── User.php [128 KB, 2024-03-05, 1,234 chars]
300+
│ │ └── Product.php [96 KB, 2024-03-12, 987 chars]
301+
```
302+
303+
### Simple Boolean Usage
304+
305+
For backward compatibility, you can still use a boolean value:
306+
307+
```yaml
308+
documents:
309+
- description: "Simple Tree View Example"
310+
outputPath: "docs/simple-tree.md"
311+
sources:
312+
- type: file
313+
description: "Files with Simple Tree View"
314+
sourcePaths: src
315+
filePattern: "*.php"
316+
treeView: false # Disable tree view
317+
```

0 commit comments

Comments
 (0)