|
| 1 | +--- |
| 2 | +name: official-game |
| 3 | +description: Add or update an official game plugin documentation page to tinker-docs from tinker-games. |
| 4 | +--- |
| 5 | + |
| 6 | +# Add or Update Official Game Plugin Documentation |
| 7 | + |
| 8 | +When the user asks to add or update a game plugin doc (e.g. "add 2048 doc", "update minesweeper readme"), follow these steps: |
| 9 | + |
| 10 | +## 1. Read plugin info |
| 11 | + |
| 12 | +Read the plugin's `package.json` from `tinker-games/packages/tinker-<name>/package.json` to get: |
| 13 | +- `tinker.name` — used as the English sidebar item text |
| 14 | +- `tinker.locales.zh-CN.name` — used as the Chinese sidebar item text |
| 15 | + |
| 16 | +Read the plugin's `README.md` from `tinker-games/packages/tinker-<name>/README.md` for content. |
| 17 | + |
| 18 | +## 2. Create or update English doc |
| 19 | + |
| 20 | +Create or update `docs/guide/official-games/<name>.md` based on the README content. Adjust install section to use a link to TINKER and a code block for the npm command. |
| 21 | + |
| 22 | +## 3. Create or update Chinese doc |
| 23 | + |
| 24 | +Create or update `docs/zh/guide/official-games/<name>.md` with the README content translated to Chinese. Keep technical terms (e.g. npm) untranslated. |
| 25 | + |
| 26 | +## 4. Update sidebar config (add only) |
| 27 | + |
| 28 | +If the plugin is new (not already in the sidebar), add an entry in `docs/.vitepress/sidebar.mts` to BOTH sidebar arrays: |
| 29 | + |
| 30 | +- English sidebar (`enSidebar` → `Official Games` items array): |
| 31 | + ```js |
| 32 | + { |
| 33 | + text: '<tinker.name value>', |
| 34 | + link: '/guide/official-games/<name>', |
| 35 | + }, |
| 36 | + ``` |
| 37 | + |
| 38 | +- Chinese sidebar (`zhSidebar` → `官方游戏` items array): |
| 39 | + ```js |
| 40 | + { |
| 41 | + text: '<tinker.locales.zh-CN.name value>', |
| 42 | + link: '/zh/guide/official-games/<name>', |
| 43 | + }, |
| 44 | + ``` |
| 45 | + |
| 46 | +## Key rules |
| 47 | + |
| 48 | +- The sidebar item `text` MUST come from `package.json`: English uses `tinker.name`, Chinese uses `tinker.locales.zh-CN.name` (if it exists, otherwise fall back to `tinker.name`) |
| 49 | +- The file name under `official-games/` should be the plugin name without the `tinker-` prefix (e.g. `tinker-2048` → `2048.md`) |
| 50 | +- The sidebar category is `Official Games` (EN) / `官方游戏` (ZH) with `collapsed: false` |
| 51 | +- Sidebar items MUST be sorted by plugin ID in alphabetical order (e.g. 2048 → cube → minesweeper) |
| 52 | +- Screenshot images should reference the raw GitHub URL from the README |
0 commit comments