|
| 1 | +# Documentation Standard |
| 2 | + |
| 3 | +This project auto-generates wiki pages from source code JSDoc comments. Follow these standards to ensure proper wiki generation. |
| 4 | + |
| 5 | +## Plugin Classes |
| 6 | + |
| 7 | +Add a JSDoc block **directly above** every exported class in `src/src/plugins/`: |
| 8 | + |
| 9 | +```typescript |
| 10 | +/** |
| 11 | + * @wiki Automatically accepts the matchmaking queue when a game is found. |
| 12 | + * @author Lyfhael |
| 13 | + * @modifier Elaina Da Catto |
| 14 | + * @usage |
| 15 | + * 1. Open League Client settings |
| 16 | + * 2. Navigate to **Elaina Theme** → **Plugin Settings** |
| 17 | + * 3. Toggle **Auto Accept** to enabled |
| 18 | + * @settings auto_accept, auto_accept_button |
| 19 | + */ |
| 20 | +export class AutoAccept { |
| 21 | +``` |
| 22 | +
|
| 23 | +### Required Tags (enforced by ESLint) |
| 24 | +
|
| 25 | +| Tag | Purpose | Example | |
| 26 | +|-----|---------|---------| |
| 27 | +| `@wiki` | User-facing feature description (displayed in wiki) | `@wiki Adds a dodge button in champion select` | |
| 28 | +
|
| 29 | +### Recommended Tags |
| 30 | +
|
| 31 | +| Tag | Purpose | Example | |
| 32 | +|-----|---------|---------| |
| 33 | +| `@author` | Original author | `@author Elaina Da Catto` | |
| 34 | +| `@modifier` | Who modified the original code | `@modifier Elaina Da Catto` | |
| 35 | +| `@usage` | Step-by-step instructions for end users | See example above | |
| 36 | +| `@settings` | Comma-separated DataStore keys this plugin uses | `@settings dodge-button, auto_accept` | |
| 37 | +
|
| 38 | +### Notes |
| 39 | +
|
| 40 | +- Use `@wiki` instead of `@description` for user-facing text. `@description` is also supported but `@wiki` takes priority. |
| 41 | +- The `@usage` tag supports Markdown formatting. |
| 42 | +- The wiki generator also detects `ElainaData.get("key")` / `ElainaData.set("key")` calls to automatically find which settings a plugin uses. |
| 43 | +
|
| 44 | +## Settings Documentation |
| 45 | +
|
| 46 | +Settings descriptions live in `docs/settings-meta.json`. When you add a new setting to `datastoreDefault.js`: |
| 47 | +
|
| 48 | +1. Add the key to `docs/settings-meta.json` with a `category`, `description`, and `type`. |
| 49 | +2. The wiki generator will warn about any missing settings. |
| 50 | +
|
| 51 | +Example entry: |
| 52 | +```json |
| 53 | +{ |
| 54 | + "auto_accept": { |
| 55 | + "category": "plugins", |
| 56 | + "description": "Automatically accept matchmaking queue when a game is found.", |
| 57 | + "type": "boolean" |
| 58 | + } |
| 59 | +} |
| 60 | +``` |
| 61 | +
|
| 62 | +### Categories |
| 63 | +
|
| 64 | +| Key | Name | Used for | |
| 65 | +|-----|------|----------| |
| 66 | +| `theme-core` | Core Theme | Basic theme behavior, version | |
| 67 | +| `wallpaper-audio` | Wallpaper & Audio | Backgrounds, audio playback | |
| 68 | +| `theme-visual` | Visual Customization | Fonts, UI tweaks, colors | |
| 69 | +| `custom-assets` | Custom Assets | Icons, banners, avatars | |
| 70 | +| `plugins` | Plugin Settings | Per-plugin configuration | |
| 71 | +| `tft` | TFT Settings | TFT-specific toggles | |
| 72 | +| `backup` | Backup & Restore | Cloud backup settings | |
| 73 | +| `deprecated` | Deprecated | Unused settings | |
| 74 | +
|
| 75 | +New categories can be added to the `categories` object in `settings-meta.json`. |
| 76 | +
|
| 77 | +## ESLint Enforcement |
| 78 | +
|
| 79 | +The ESLint config (`eslint.config.js`) enforces documentation rules: |
| 80 | +
|
| 81 | +- **Current level**: `warn` — shows warnings but doesn't block commits |
| 82 | +- **To enforce strictly**: Change `warn` → `error` in `eslint.config.js` for `jsdoc/require-jsdoc` and `jsdoc/require-description` |
| 83 | +
|
| 84 | +## Git Hooks |
| 85 | +
|
| 86 | +- **Pre-commit**: Runs ESLint on staged files via `lint-staged` |
| 87 | +- **Pre-push**: Runs full lint + wiki validation (`--check` mode) |
| 88 | +
|
| 89 | +## Wiki Generation |
| 90 | +
|
| 91 | +```bash |
| 92 | +# Generate wiki locally |
| 93 | +pnpm run wiki:generate |
| 94 | + |
| 95 | +# Check documentation coverage (no file writes) |
| 96 | +pnpm run wiki:check |
| 97 | +``` |
| 98 | +
|
| 99 | +The GitHub Action (`.github/workflows/generate-wiki.yml`) runs on push to `main` and auto-publishes to the repo wiki. |
0 commit comments