|
| 1 | + |
| 2 | + |
| 3 | + # How to Use the "Generate Documentation" Command in Dev-Docs VSCode Extension |
| 4 | + |
| 5 | +## Using the Command |
| 6 | + |
| 7 | +### From the Context Menu |
| 8 | + |
| 9 | +1. Right-click in your code file. |
| 10 | +2. Select "Generate Documentation" from the context menu. |
| 11 | + |
| 12 | +### Using the Shortcut |
| 13 | + |
| 14 | +- On Mac: Press `Shift + Command + D` |
| 15 | +- On Windows/Linux: Press `Shift + Ctrl + D` |
| 16 | + |
| 17 | +## Customizing AI Generation |
| 18 | + |
| 19 | +To customize the AI generation of the "Generate Documentation" command, you can modify the `dev-docs.json` file in your project root. |
| 20 | + |
| 21 | +1. Open `dev-docs.json` in your project root. |
| 22 | +2. Locate the `ai` section in the JSON. |
| 23 | +3. Customize the following properties: |
| 24 | + |
| 25 | +```json |
| 26 | +{ |
| 27 | + "ai": { |
| 28 | + "internalTypeFilters": ["class", "method", "function"], |
| 29 | + "codeFilters": ["async function", "export default"], |
| 30 | + "nameFilters": ["handleSubmit", "render"], |
| 31 | + "contextPrompt": "your custom prompt or path to prompt template", |
| 32 | + "defaultLength": "3-5 Sentences" |
| 33 | + } |
| 34 | +} |
| 35 | +``` |
| 36 | + |
| 37 | +### Key Properties: |
| 38 | + |
| 39 | +- `internalTypeFilters`: Array of symbol types to include in documentation. |
| 40 | +- `codeFilters`: Array of code patterns to filter for documentation. |
| 41 | +- `nameFilters`: Array of function or method names to specifically target. |
| 42 | +- `contextPrompt`: Custom prompt for AI generation or path to a prompt template file. |
| 43 | +- `defaultLength`: Desired length of generated documentation. |
| 44 | + |
| 45 | +By adjusting these properties, you can fine-tune the AI-generated documentation to better suit your project's needs. |
| 46 | + |
| 47 | + |
0 commit comments