Updated ToC on docs intro; updated title casing to match Google style (#13717)

This commit is contained in:
David Huntsperger
2025-12-01 11:38:48 -08:00
committed by GitHub
parent bde8b78a88
commit 26f050ff10
58 changed files with 660 additions and 642 deletions
+18 -18
View File
@@ -27,21 +27,21 @@ More content here.
@./shared/configuration.md
```
## Supported Path Formats
## Supported path formats
### Relative Paths
### Relative paths
- `@./file.md` - Import from the same directory
- `@../file.md` - Import from parent directory
- `@./components/file.md` - Import from subdirectory
### Absolute Paths
### Absolute paths
- `@/absolute/path/to/file.md` - Import using absolute path
## Examples
### Basic Import
### Basic import
```markdown
# My GEMINI.md
@@ -55,7 +55,7 @@ Welcome to my project!
@./features/overview.md
```
### Nested Imports
### Nested imports
The imported files can themselves contain imports, creating a nested structure:
@@ -73,9 +73,9 @@ The imported files can themselves contain imports, creating a nested structure:
@./shared/title.md
```
## Safety Features
## Safety features
### Circular Import Detection
### Circular import detection
The processor automatically detects and prevents circular imports:
@@ -89,37 +89,37 @@ The processor automatically detects and prevents circular imports:
@./file-a.md <!-- This will be detected and prevented -->
```
### File Access Security
### File access security
The `validateImportPath` function ensures that imports are only allowed from
specified directories, preventing access to sensitive files outside the allowed
scope.
### Maximum Import Depth
### Maximum import depth
To prevent infinite recursion, there's a configurable maximum import depth
(default: 5 levels).
## Error Handling
## Error handling
### Missing Files
### Missing files
If a referenced file doesn't exist, the import will fail gracefully with an
error comment in the output.
### File Access Errors
### File access errors
Permission issues or other file system errors are handled gracefully with
appropriate error messages.
## Code Region Detection
## Code region detection
The import processor uses the `marked` library to detect code blocks and inline
code spans, ensuring that `@` imports inside these regions are properly ignored.
This provides robust handling of nested code blocks and complex Markdown
structures.
## Import Tree Structure
## Import tree structure
The processor returns an import tree that shows the hierarchy of imported files,
similar to Claude's `/memory` feature. This helps users debug problems with
@@ -143,7 +143,7 @@ Memory Files
The tree preserves the order that files were imported and shows the complete
import chain for debugging purposes.
## Comparison to Claude Code's `/memory` (`claude.md`) Approach
## Comparison to Claude Code's `/memory` (`claude.md`) approach
Claude Code's `/memory` feature (as seen in `claude.md`) produces a flat, linear
document by concatenating all included files, always marking file boundaries
@@ -154,7 +154,7 @@ for reconstructing the hierarchy if needed.
> [!NOTE] The import tree is mainly for clarity during development and has
> limited relevance to LLM consumption.
## API Reference
## API reference
### `processImports(content, basePath, debugMode?, importState?)`
@@ -225,7 +225,7 @@ directory if no `.git` is found)
## Troubleshooting
### Common Issues
### Common issues
1. **Import not working**: Check that the file exists and the path is correct
2. **Circular import warnings**: Review your import structure for circular
@@ -235,7 +235,7 @@ directory if no `.git` is found)
4. **Path resolution issues**: Use absolute paths if relative paths aren't
resolving correctly
### Debug Mode
### Debug mode
Enable debug mode to see detailed logging of the import process: