|
| 1 | +# Configuration |
| 2 | + |
| 3 | +Currently, CodebaseMD does not have user-configurable settings through the Visual Studio Code settings interface. However, you can customize some behaviors by modifying the source code directly. |
| 4 | + |
| 5 | +## Customizing Ignored Files and Directories |
| 6 | + |
| 7 | +To change which files and directories are ignored during export: |
| 8 | + |
| 9 | +1. Open the `src/extension.ts` file in the project |
| 10 | +2. Locate the `createIgnoreInstance` function |
| 11 | +3. Modify the `ig.add()` call to add or remove patterns from the ignore list |
| 12 | + |
| 13 | +Example: |
| 14 | + |
| 15 | +```typescript |
| 16 | +ig.add([ |
| 17 | + 'node_modules/', |
| 18 | + 'build/', |
| 19 | + 'out/', |
| 20 | + 'dist/', |
| 21 | + '.git/', |
| 22 | + // Add your custom ignore patterns here |
| 23 | + 'custom-ignore-folder/', |
| 24 | + '*.custom-extension' |
| 25 | +]); |
| 26 | +``` |
| 27 | + |
| 28 | +## Customizing Supported File Types |
| 29 | + |
| 30 | +To change which file types are considered "supported" and have their contents included in the export: |
| 31 | + |
| 32 | +1. Open the `src/extension.ts` file |
| 33 | +2. Find the `isSupportedFile` function |
| 34 | +3. Modify the `supportedExtensions` array to add or remove file extensions |
| 35 | + |
| 36 | +Example: |
| 37 | + |
| 38 | +```typescript |
| 39 | +const supportedExtensions = [ |
| 40 | + '.js', '.jsx', '.ts', '.tsx', '.html', '.css', '.scss', '.json', '.md', '.txt', |
| 41 | + '.py', '.java', '.c', '.cpp', '.cs', '.rb', '.go', '.php', '.sh', '.xml', |
| 42 | + // Add your custom extensions here |
| 43 | + '.custom', '.myext' |
| 44 | +]; |
| 45 | +``` |
| 46 | + |
| 47 | +## Customizing Large File Exclusions |
| 48 | + |
| 49 | +To change which files are considered "large" and excluded from the export: |
| 50 | + |
| 51 | +1. Open the `src/extension.ts` file |
| 52 | +2. Locate the `isLargeFile` function |
| 53 | +3. Modify the `largeFiles` array to add or remove file names |
| 54 | + |
| 55 | +Example: |
| 56 | + |
| 57 | +```typescript |
| 58 | +function isLargeFile(fileName: string): boolean { |
| 59 | + const largeFiles = ['package-lock.json', 'yarn.lock', 'my-large-file.json']; |
| 60 | + return largeFiles.includes(fileName); |
| 61 | +} |
| 62 | +``` |
| 63 | + |
| 64 | +**Note**: After making any changes to the source code, you'll need to recompile the extension and reinstall it in Visual Studio Code for the changes to take effect. |
| 65 | + |
| 66 | +## Future Configuration Plans |
| 67 | + |
| 68 | +We plan to add user-configurable settings in future versions of CodebaseMD. This will allow users to customize the extension's behavior without modifying the source code. If you have suggestions for configurable options, please [open an issue](https://github.com/alpha912/codebase-md/issues) on GitHub. |
0 commit comments