|
| 1 | + |
| 2 | + |
| 3 | + # How to Use and Customize the "Populate External Docs" Command in the VS Code Extension |
| 4 | + |
| 5 | +## Step 1: Access the Command |
| 6 | + |
| 7 | +1. Open your VS Code workspace |
| 8 | +2. Press `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux) to open the command palette |
| 9 | +3. Type "Populate External Docs" and select the command |
| 10 | + |
| 11 | + |
| 12 | +## Step 2: Customizing Generation with dev-docs.json |
| 13 | + |
| 14 | +To customize the documentation generation, modify the `dev-docs.json` file in your project root: |
| 15 | + |
| 16 | +1. Create or open `dev-docs.json` |
| 17 | +2. Add an `ai` object with customization options |
| 18 | + |
| 19 | +Example `dev-docs.json`: |
| 20 | + |
| 21 | +```json |
| 22 | +{ |
| 23 | + "ai": { |
| 24 | + "internalTypeFilters": ["class", "method", "function"], |
| 25 | + "codeFilters": [], |
| 26 | + "nameFilters": [], |
| 27 | + "docSubFolder": "api/", |
| 28 | + "merge": true, |
| 29 | + "externalDocPrompt": "Generate comprehensive API documentation" |
| 30 | + } |
| 31 | +} |
| 32 | +``` |
| 33 | + |
| 34 | +Key customization options: |
| 35 | + |
| 36 | +- `internalTypeFilters`: Specify which code elements to document |
| 37 | +- `docSubFolder`: Set the output folder for generated docs |
| 38 | +- `merge`: Combine multiple elements into a single document |
| 39 | +- `externalDocPrompt`: Customize the AI prompt for doc generation |
| 40 | + |
| 41 | +The `generateBySymbols` function in `src/AiServices.ts` uses these settings to generate documentation. |
| 42 | + |
| 43 | +## Step 3: Review and Edit |
| 44 | + |
| 45 | +After running the command: |
| 46 | + |
| 47 | +1. Check the `docs` folder (or your specified `docSubFolder`) for generated files |
| 48 | +2. Review and edit the generated content as needed |
| 49 | +3. Commit changes to your repository |
| 50 | + |
| 51 | +By following these steps and customizing the `dev-docs.json`, you can efficiently generate and manage external documentation for your project using the VS Code extension. |
| 52 | + |
| 53 | + |
0 commit comments