Overview
Exclusion patterns allow you to control which files and folders appear in your generated structure. This is essential for creating clean, focused documentation by omitting build artifacts, dependencies, and other irrelevant items.How Exclusion Patterns Work
The extension uses glob pattern syntax to match files and folders for exclusion. Patterns are matched against the full path of each item relative to your project root.The extension uses the fast-glob library for pattern matching, which supports standard glob syntax.
Glob Pattern Syntax
Understanding glob patterns is key to effective exclusions:Basic Wildcards
Basic Wildcards
* - Matches any characters except /** - Matches any characters including / (recursive)? - Matches exactly one characterCharacter Sets
Character Sets
[abc] - Matches any character in the set[a-z] - Matches any character in the range[!abc] - Matches any character NOT in the setBrace Expansion
Brace Expansion
{a,b,c} - Matches any of the comma-separated patternsNegation
Negation
!pattern - Includes items that match the pattern (overrides exclusions)Default Exclusion Patterns
The extension comes with sensible defaults that exclude common build artifacts and dependencies:Why These Defaults?
**/node_modules- npm/yarn dependencies (can contain thousands of files)**/.git- Git internal files (not relevant for structure documentation)**/dist- Compiled/built files**/.next- Next.js build output**/out- Common output directory name
These defaults are a starting point. You can modify or extend them based on your project’s needs.
Common Exclusion Patterns
Exclude by Folder Name
Exclude specific folders anywhere in your project:Exclude by File Extension
Exclude all files with specific extensions:Exclude Specific Files
Exclude specific files by name:Framework-Specific Patterns
- React/Next.js
- Vue/Nuxt
- Angular
- Python
- Rust
- Go
Advanced Pattern Examples
Exclude Multiple File Types
Use brace expansion for multiple extensions:Exclude Test Files
Exclude various test file patterns:Exclude Hidden Files and Folders
Exclude items starting with a dot:Platform-Specific Files
Exclude OS-specific files:Pattern Matching Examples
Here are some real-world examples showing what different patterns match:Combining with .gitignore
When you enable therespectGitignore setting, exclusion patterns work alongside your .gitignore rules:
When to Use Each
Exclusion Patterns:- Project structure standards
- Build artifacts
- Documentation-specific exclusions
- Version control exclusions
- Environment-specific files
- Generated code
Testing Your Patterns
To test if your patterns work as expected:- Configure your exclusion patterns
- Right-click on a folder in VS Code
- Select “Generate Markdown structure”
- Review the generated output
- Adjust patterns as needed
Common Mistakes
Forgetting the ** prefix
Forgetting the ** prefix
Wrong:
"node_modules"This only matches node_modules at the root.Correct: "**/node_modules"This matches node_modules at any level.Using backslashes on Windows
Using backslashes on Windows
Wrong:
"**\\dist"Always use forward slashes in glob patterns.Correct: "**/dist"Forward slashes work on all platforms.Negation pattern order
Negation pattern order
Wrong:Correct:Negation patterns must come after what they’re overriding.
Excluding too much
Excluding too much
Be careful not to exclude important project files:Too broad:
"**/src"This excludes your entire source directory!Better: "**/src/generated"Be specific about what you want to exclude.Configuration Templates
Minimal (Keep Defaults)
Comprehensive Web Project
Documentation-Focused
Next Steps
Configuration
Learn about all configuration options
Advanced Usage
Combine exclusions with other advanced features
Styling Options
Customize the visual appearance of your structure