|
| 1 | +# Configuring Dev-Docs: Setting Up the Dev-Docs.JSON |
| 2 | + |
| 3 | +This guide will walk you through the configuration options available in the `dev-docs.json` file for the Dev-Docs extension. |
| 4 | + |
| 5 | +## Step 1: Locate the Configuration File |
| 6 | + |
| 7 | +Find or create the `dev-docs.json` file in your project's root directory. |
| 8 | + |
| 9 | +## Step 2: Understanding the Structure |
| 10 | + |
| 11 | +The `dev-docs.json` file has two main sections: |
| 12 | + |
| 13 | +1. `quickDoc` |
| 14 | +2. `ai` |
| 15 | + |
| 16 | +## Step 3: Configuring quickDoc |
| 17 | + |
| 18 | +The `quickDoc` section is used for quick documentation prompts. Here's an example: |
| 19 | + |
| 20 | +```json |
| 21 | +{ |
| 22 | + "quickDoc": { |
| 23 | + "variablesAndFunctions": { |
| 24 | + "prompts": [ |
| 25 | + { |
| 26 | + "question": "Does this code use a third-party library?", |
| 27 | + "title": "Third-Party Libraries" |
| 28 | + } |
| 29 | + ] |
| 30 | + } |
| 31 | + } |
| 32 | +} |
| 33 | +``` |
| 34 | + |
| 35 | +## Step 4: Configuring AI |
| 36 | + |
| 37 | +The `ai` section contains various settings for AI-assisted documentation. Here's an example with common options: |
| 38 | + |
| 39 | +```json |
| 40 | +{ |
| 41 | + "ai": { |
| 42 | + "docPath": "docs", |
| 43 | + "codeSummaryPrompt": "Provide 3 bullet points on what this code does", |
| 44 | + "defaultLength": "3-5 Sentences", |
| 45 | + "branch": "main", |
| 46 | + "internalTypeFilters": ["class", "method", "function"], |
| 47 | + "codeFilters": ["async function", "export default"], |
| 48 | + "nameFilters": ["handleSubmit", "render"], |
| 49 | + "contextDirs": ["src/utils", "src/helpers"], |
| 50 | + "openapi": { |
| 51 | + "file": "src/api/openapi.yaml", |
| 52 | + "x-codeSamples": { |
| 53 | + "langs": ["javascript", "python", "ruby"] |
| 54 | + } |
| 55 | + } |
| 56 | + } |
| 57 | +} |
| 58 | +``` |
| 59 | + |
| 60 | +## Step 5: Configuration Options Table |
| 61 | + |
| 62 | +| Option | Type | Description | Default | |
| 63 | +|--------|------|-------------|---------| |
| 64 | +| `quickDoc.variablesAndFunctions.prompts` | Array | Quick documentation prompts | See example | |
| 65 | +| `ai.docPath` | String | Custom path for documentation | "some custom path" | |
| 66 | +| `ai.codeSummaryPrompt` | String | Prompt for code summaries | "3 Bullet points on what the code does" | |
| 67 | +| `ai.defaultLength` | String | Default response length | "3-5 Sentences" | |
| 68 | +| `ai.branch` | String | Git branch for documentation | "main" | |
| 69 | +| `ai.internalTypeFilters` | Array | Filters for code types | ["file", "module", "class", ...] | |
| 70 | +| `ai.codeFilters` | Array | Filters for code patterns | ["async function", "export default"] | |
| 71 | +| `ai.nameFilters` | Array | Filters for function names | ["handleSubmit", "render"] | |
| 72 | +| `ai.contextDirs` | Array | Directories for context generation | ["src/utils", "src/helpers"] | |
| 73 | +| `ai.openapi.file` | String | Path to OpenAPI specification | "src/api/openapi.yaml" | |
| 74 | +| `ai.openapi.x-codeSamples.langs` | Array | Languages for code samples | ["javascript", "python", "ruby"] | |
| 75 | + |
| 76 | +## Step 6: Advanced Configuration |
| 77 | + |
| 78 | +For more advanced use cases, you can configure folder-specific prompts: |
| 79 | + |
| 80 | +```json |
| 81 | +{ |
| 82 | + "ai": { |
| 83 | + "variablesAndFunctions": { |
| 84 | + "src/components": { |
| 85 | + "prompts": [ |
| 86 | + { |
| 87 | + "title": "Component Props", |
| 88 | + "question": "What props does this component accept?", |
| 89 | + "documentation": "List the props with their types and descriptions." |
| 90 | + } |
| 91 | + ] |
| 92 | + } |
| 93 | + } |
| 94 | + } |
| 95 | +} |
| 96 | +``` |
| 97 | + |
| 98 | +By following these steps and using the provided examples and table, you can effectively configure the Dev-Docs extension to suit your project's documentation needs. |
| 99 | + |
| 100 | + |
0 commit comments