|
| 1 | +# Contributing to ORC Documentation |
| 2 | + |
| 3 | +This guide is for maintaining and updating the ORC documentation site. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Local Setup |
| 8 | + |
| 9 | +### First Time |
| 10 | + |
| 11 | +```bash |
| 12 | +cd /mnt/4TB_SSD_1/ORC |
| 13 | +python -m venv .venv |
| 14 | +source .venv/bin/activate |
| 15 | +pip install mkdocs-material "mkdocstrings[python]" |
| 16 | +``` |
| 17 | + |
| 18 | +### Build and Serve |
| 19 | + |
| 20 | +```bash |
| 21 | +source .venv/bin/activate |
| 22 | +mkdocs serve |
| 23 | +``` |
| 24 | + |
| 25 | +Then open http://localhost:8000 |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +## File Structure |
| 30 | + |
| 31 | +``` |
| 32 | +docs/ |
| 33 | +├── index.md # Landing page |
| 34 | +├── built-with.md # Built with dynabots-core |
| 35 | +├── getting-started/ |
| 36 | +│ ├── installation.md # How to install ORC |
| 37 | +│ ├── quick-start.md # Quick start example |
| 38 | +│ └── concepts.md # Core concepts explained |
| 39 | +├── guides/ |
| 40 | +│ ├── model-showdown.md # Compare models |
| 41 | +│ ├── custom-judges.md # Build custom judges |
| 42 | +│ ├── strategies.md # Challenge strategies |
| 43 | +│ └── use-cases.md # Real-world use cases |
| 44 | +└── reference/ |
| 45 | + ├── arena.md # Arena API (auto-generated) |
| 46 | + ├── warrior.md # Warrior API (auto-generated) |
| 47 | + ├── elder.md # Elder API (auto-generated) |
| 48 | + ├── judges.md # Judges API (auto-generated) |
| 49 | + └── strategies.md # Strategies API (auto-generated) |
| 50 | +``` |
| 51 | + |
| 52 | +--- |
| 53 | + |
| 54 | +## Editing Guide |
| 55 | + |
| 56 | +### Creating a New Page |
| 57 | + |
| 58 | +1. Create `.md` file in the appropriate directory |
| 59 | +2. Add to navigation in `mkdocs.yml` |
| 60 | +3. Run `mkdocs serve` to preview |
| 61 | +4. Check links and formatting |
| 62 | + |
| 63 | +### Writing Content |
| 64 | + |
| 65 | +- Use Markdown syntax |
| 66 | +- Code fences with language: ` ```python ... ``` ` |
| 67 | +- Headings: `#` (H1), `##` (H2), `###` (H3) |
| 68 | +- Links: `[text](url)` |
| 69 | +- Images: `` |
| 70 | + |
| 71 | +### Code Examples |
| 72 | + |
| 73 | +Always provide working examples: |
| 74 | + |
| 75 | +```python |
| 76 | +# Good: Complete, runnable example |
| 77 | +import asyncio |
| 78 | +from orc import TheArena, Warrior, Elder |
| 79 | + |
| 80 | +async def main(): |
| 81 | + warrior = Warrior(...) |
| 82 | + elder = Elder(...) |
| 83 | + arena = TheArena(...) |
| 84 | + result = await arena.battle("task") |
| 85 | + print(result.winner) |
| 86 | + |
| 87 | +asyncio.run(main()) |
| 88 | +``` |
| 89 | + |
| 90 | +```python |
| 91 | +# Avoid: Incomplete snippets |
| 92 | +arena = TheArena(...) # Missing imports and setup |
| 93 | +``` |
| 94 | + |
| 95 | +### API Reference Pages |
| 96 | + |
| 97 | +Reference pages use auto-generation via `mkdocstrings`: |
| 98 | + |
| 99 | +```markdown |
| 100 | +# Arena |
| 101 | + |
| 102 | +The core orchestration component. |
| 103 | + |
| 104 | +::: orc.arena.arena.Arena |
| 105 | + options: |
| 106 | + docstring_style: google |
| 107 | +``` |
| 108 | + |
| 109 | +This pulls docstrings directly from Python source code. Keep docstrings updated in the code: |
| 110 | + |
| 111 | +```python |
| 112 | +class Arena: |
| 113 | + """Brief description. |
| 114 | +
|
| 115 | + Longer description with example. |
| 116 | +
|
| 117 | + Example: |
| 118 | + arena = Arena(agents=[...], judge=...) |
| 119 | + result = await arena.process("task") |
| 120 | +
|
| 121 | + Args: |
| 122 | + agents: List of agents. |
| 123 | + judge: Judge to evaluate trials. |
| 124 | + """ |
| 125 | +``` |
| 126 | + |
| 127 | +--- |
| 128 | + |
| 129 | +## Theme Configuration |
| 130 | + |
| 131 | +Edit `mkdocs.yml` to customize: |
| 132 | + |
| 133 | +### Colors |
| 134 | + |
| 135 | +```yaml |
| 136 | +theme: |
| 137 | + palette: |
| 138 | + - scheme: slate # Dark theme |
| 139 | + primary: red # Change to blue, green, etc. |
| 140 | + accent: deep orange |
| 141 | + - scheme: default # Light theme |
| 142 | + primary: red |
| 143 | + accent: deep orange |
| 144 | +``` |
| 145 | +
|
| 146 | +### Fonts |
| 147 | +
|
| 148 | +```yaml |
| 149 | + font: |
| 150 | + text: Inter |
| 151 | + code: JetBrains Mono |
| 152 | +``` |
| 153 | +
|
| 154 | +### Navigation |
| 155 | +
|
| 156 | +```yaml |
| 157 | +nav: |
| 158 | + - Home: index.md |
| 159 | + - Section Name: |
| 160 | + - Page Title: path/to/page.md |
| 161 | +``` |
| 162 | +
|
| 163 | +### Plugins |
| 164 | +
|
| 165 | +Currently enabled: |
| 166 | +- `search` — Full-text search |
| 167 | +- `mkdocstrings` — Auto-generate API docs from docstrings |
| 168 | + |
| 169 | +--- |
| 170 | + |
| 171 | +## Deployment |
| 172 | + |
| 173 | +### Manual Deploy |
| 174 | + |
| 175 | +```bash |
| 176 | +source .venv/bin/activate |
| 177 | +mkdocs gh-deploy --force |
| 178 | +``` |
| 179 | + |
| 180 | +This builds and deploys to `gh-pages` branch. |
| 181 | + |
| 182 | +### Automatic Deploy |
| 183 | + |
| 184 | +Push to `main` branch. GitHub Actions automatically: |
| 185 | +1. Installs dependencies |
| 186 | +2. Builds documentation |
| 187 | +3. Deploys to GitHub Pages |
| 188 | + |
| 189 | +Workflow file: `.github/workflows/docs.yml` |
| 190 | + |
| 191 | +--- |
| 192 | + |
| 193 | +## Content Guidelines |
| 194 | + |
| 195 | +### Tone |
| 196 | + |
| 197 | +- **Friendly but professional** — Use ORC theming (Warriors, Warchiefs) but stay clear |
| 198 | +- **Practical** — Include working code examples |
| 199 | +- **Thorough** — Explain the "why" not just the "how" |
| 200 | + |
| 201 | +### Structure |
| 202 | + |
| 203 | +- **Lead with use case** — Why would someone use this? |
| 204 | +- **Show code first** — Working example early |
| 205 | +- **Explain concepts** — Deep dive into mechanics |
| 206 | +- **Provide patterns** — How to apply in real scenarios |
| 207 | + |
| 208 | +### Code Style |
| 209 | + |
| 210 | +- Match project's Python style |
| 211 | +- Use type hints |
| 212 | +- Include docstrings |
| 213 | +- Comment complex logic |
| 214 | + |
| 215 | +--- |
| 216 | + |
| 217 | +## Common Tasks |
| 218 | + |
| 219 | +### Update Installation Guide |
| 220 | + |
| 221 | +Edit `docs/getting-started/installation.md` |
| 222 | +- Add new provider support |
| 223 | +- Update version requirements |
| 224 | +- Add new installation options |
| 225 | + |
| 226 | +### Add a New Guide |
| 227 | + |
| 228 | +1. Create `docs/guides/your-guide.md` |
| 229 | +2. Add to `mkdocs.yml` under Guides |
| 230 | +3. Link from other pages if relevant |
| 231 | +4. Test locally: `mkdocs serve` |
| 232 | + |
| 233 | +### Update API Reference |
| 234 | + |
| 235 | +API reference pages are auto-generated from Python docstrings. To update: |
| 236 | +1. Edit docstring in source code (e.g., `orc/arena/arena.py`) |
| 237 | +2. The docs will auto-regenerate on next build |
| 238 | +3. Run `mkdocs serve` to see changes |
| 239 | + |
| 240 | +--- |
| 241 | + |
| 242 | +## Troubleshooting |
| 243 | + |
| 244 | +### Build fails |
| 245 | + |
| 246 | +```bash |
| 247 | +source .venv/bin/activate |
| 248 | +pip install --upgrade mkdocs-material mkdocstrings[python] |
| 249 | +mkdocs build |
| 250 | +``` |
| 251 | + |
| 252 | +### Links are broken |
| 253 | + |
| 254 | +Check the path. Link paths should be relative: |
| 255 | +- Good: `../../reference/arena.md` or `../guides/custom-judges.md` |
| 256 | +- Bad: `/docs/reference/arena.md` |
| 257 | + |
| 258 | +### Code not highlighting |
| 259 | + |
| 260 | +Ensure fence language is specified: |
| 261 | +- Good: ` ```python ... ``` ` |
| 262 | +- Bad: ` ```code ... ``` ` or ` ```python ... ``` ` (without language) |
| 263 | + |
| 264 | +### Missing content in API reference |
| 265 | + |
| 266 | +Check that: |
| 267 | +1. Module/class path is correct in `.md` file |
| 268 | +2. Docstrings exist in Python source |
| 269 | +3. Docstring style matches config (Google style) |
| 270 | + |
| 271 | +--- |
| 272 | + |
| 273 | +## Preview Before Publishing |
| 274 | + |
| 275 | +Always run locally: |
| 276 | + |
| 277 | +```bash |
| 278 | +mkdocs serve |
| 279 | +``` |
| 280 | + |
| 281 | +Test: |
| 282 | +- Links (click around) |
| 283 | +- Code examples (are they readable?) |
| 284 | +- Dark/light mode toggle |
| 285 | +- Mobile responsiveness (resize browser) |
| 286 | +- Search functionality |
| 287 | + |
| 288 | +--- |
| 289 | + |
| 290 | +## Publishing Checklist |
| 291 | + |
| 292 | +Before pushing to main: |
| 293 | + |
| 294 | +- [ ] Ran `mkdocs serve` and verified |
| 295 | +- [ ] All links work |
| 296 | +- [ ] Code examples are complete and correct |
| 297 | +- [ ] No spelling/grammar errors |
| 298 | +- [ ] Consistent with existing style |
| 299 | +- [ ] Added to navigation if new page |
| 300 | +- [ ] Tested dark and light themes |
| 301 | + |
| 302 | +--- |
| 303 | + |
| 304 | +## Questions? |
| 305 | + |
| 306 | +Refer to: |
| 307 | +- [MkDocs Documentation](https://www.mkdocs.org/) |
| 308 | +- [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) |
| 309 | +- [mkdocstrings](https://mkdocstrings.github.io/) |
| 310 | + |
| 311 | +--- |
| 312 | + |
| 313 | +Happy documenting! |
0 commit comments