|
| 1 | +# Copilot Instructions for unraid-plugin-docs |
| 2 | + |
| 3 | +This is a Jekyll documentation site for Unraid plugin development, hosted on GitHub Pages using the [just-the-docs](https://just-the-docs.github.io/just-the-docs/) theme. |
| 4 | + |
| 5 | +## Project Structure |
| 6 | + |
| 7 | +``` |
| 8 | +docs/ # Markdown documentation files (the main content) |
| 9 | +_config.yml # Jekyll configuration (theme, navigation, collections) |
| 10 | +index.md # Homepage with Jekyll front matter |
| 11 | +Gemfile # Ruby dependencies (jekyll ~> 4.3, just-the-docs ~> 0.8) |
| 12 | +``` |
| 13 | + |
| 14 | +## Documentation Conventions |
| 15 | + |
| 16 | +### Front Matter for Doc Pages |
| 17 | +All pages in `docs/` should have front matter. The just-the-docs theme uses `nav_order` for menu position: |
| 18 | + |
| 19 | +```yaml |
| 20 | +--- |
| 21 | +layout: default |
| 22 | +title: Page Title |
| 23 | +nav_order: 3 |
| 24 | +--- |
| 25 | +``` |
| 26 | + |
| 27 | +### Markdown Style |
| 28 | +- Use `#` for the main title (matches `title` in front matter) |
| 29 | +- Tables for reference information (attributes, commands, events) |
| 30 | +- Code blocks with language hints: ` ```xml `, ` ```php `, ` ```bash ` |
| 31 | +- ASCII diagrams for architecture/flow concepts (see `docs/filesystem.md` for examples) |
| 32 | +- Callouts use just-the-docs syntax: `{: .warning }` or `> ⚠️ **Note**:` |
| 33 | + |
| 34 | +### Documenting Unraid Concepts |
| 35 | +When documenting Unraid plugin patterns, include: |
| 36 | +1. **What it is** - Brief explanation |
| 37 | +2. **File/directory location** - Persistence info (USB vs RAM) |
| 38 | +3. **Code example** - Complete, working snippet |
| 39 | +4. **Common patterns** - Real-world usage from existing plugins |
| 40 | + |
| 41 | +## Build & Preview |
| 42 | + |
| 43 | +### Local Development |
| 44 | +```bash |
| 45 | +bundle install # Install dependencies |
| 46 | +bundle exec jekyll serve # Local preview at http://localhost:4000/unraid-plugin-docs/ |
| 47 | +``` |
| 48 | + |
| 49 | +### CI/CD Pipeline |
| 50 | +GitHub Actions automatically builds and deploys on push to `main` branch (see `.github/workflows/pages.yml`): |
| 51 | +- **Trigger**: Push to `main` or manual `workflow_dispatch` |
| 52 | +- **Build**: Ruby 3.1, `bundle exec jekyll build` |
| 53 | +- **Deploy**: GitHub Pages artifact deployment |
| 54 | +- **URL**: https://mstrhakr.github.io/unraid-plugin-docs/ |
| 55 | + |
| 56 | +Pull requests to `main` should be used for changes; the site rebuilds automatically on merge. |
| 57 | + |
| 58 | +## Key Unraid Concepts Documented |
| 59 | + |
| 60 | +This documentation covers Unraid-specific patterns. When writing or editing: |
| 61 | + |
| 62 | +| Concept | Key Points | |
| 63 | +|---------|-----------| |
| 64 | +| **PLG files** | XML plugin installers with DOCTYPE entities, FILE elements | |
| 65 | +| **Page files** | `.page` files with header/content separator `---` | |
| 66 | +| **Events** | Scripts in `event/` directory, blocking behavior warning | |
| 67 | +| **Persistence** | `/boot/config/plugins/` survives reboot; `/usr/local/emhttp/` is RAM | |
| 68 | + |
| 69 | +## Adding New Documentation Pages |
| 70 | + |
| 71 | +1. Create `docs/new-topic.md` with proper front matter |
| 72 | +2. Add to navigation in the appropriate section (see `index.md` links) |
| 73 | +3. Cross-reference from related pages |
| 74 | +4. Include working code examples from real plugins like `dynamix.*` or `compose.manager` |
| 75 | + |
| 76 | +## External References |
| 77 | + |
| 78 | +Link to real plugin repositories for complex examples: |
| 79 | +- [Dynamix plugins](https://github.com/unraid/dynamix) - Official reference implementation |
| 80 | +- [Community Applications](https://github.com/Squidly271/community.applications) - Complex PHP patterns |
| 81 | +- [Compose Manager](https://github.com/dcflachs/compose_plugin) - Docker integration patterns |
0 commit comments