|
| 1 | +# Compose Rules Documentation |
| 2 | + |
| 3 | +This directory contains the source documentation for Compose Rules, which is built |
| 4 | +using [MkDocs](https://www.mkdocs.org/) with the [Material theme](https://squidfunk.github.io/mkdocs-material/). |
| 5 | + |
| 6 | +## Documentation Structure |
| 7 | + |
| 8 | +- `index.md` - Overview and introduction |
| 9 | +- `ktlint.md` - Guide for using Compose Rules with ktlint |
| 10 | +- `detekt.md` - Guide for using Compose Rules with detekt |
| 11 | +- `rules.md` - Comprehensive list of all rules with examples |
| 12 | + |
| 13 | +## Versioning |
| 14 | + |
| 15 | +The documentation is **versioned** using [mike](https://github.com/jimporter/mike): |
| 16 | + |
| 17 | +- **Stable versions** (e.g., `0.5.0`, `0.4.0`) - Created automatically when a release tag is pushed |
| 18 | +- **Development version** (`next`) - Updated automatically on every push to `main` branch |
| 19 | +- **Default version** (`latest`) - Always points to the most recent stable release |
| 20 | + |
| 21 | +### Viewing Different Versions |
| 22 | + |
| 23 | +Visit the [documentation site](https://mrmans0n.github.io/compose-rules/) and use the version selector in the header to |
| 24 | +switch between: |
| 25 | + |
| 26 | +- Latest stable version (default) |
| 27 | +- Specific release versions |
| 28 | +- Next (development) version |
| 29 | + |
| 30 | +## Local Development |
| 31 | + |
| 32 | +### Quick Preview (Recommended) |
| 33 | + |
| 34 | +For fast iteration when writing documentation: |
| 35 | + |
| 36 | +```bash |
| 37 | +# Install dependencies (first time only) |
| 38 | +uv sync |
| 39 | + |
| 40 | +# Serve the docs locally |
| 41 | +uv run mkdocs serve |
| 42 | +``` |
| 43 | + |
| 44 | +Visit `http://localhost:8000` to see your changes live. This serves the current docs without versioning. |
| 45 | + |
| 46 | +### Preview with Versioning |
| 47 | + |
| 48 | +To see how the documentation will look with the version selector: |
| 49 | + |
| 50 | +```bash |
| 51 | +# Deploy a test version locally (won't push to GitHub) |
| 52 | +uv run mike deploy dev --no-push |
| 53 | + |
| 54 | +# Serve with version selector |
| 55 | +uv run mike serve |
| 56 | +``` |
| 57 | + |
| 58 | +Visit `http://localhost:8000` to see the versioned site. |
| 59 | + |
| 60 | +## Making Changes |
| 61 | + |
| 62 | +1. Edit the relevant `.md` files in this directory |
| 63 | +2. Preview your changes locally with `mkdocs serve` |
| 64 | +3. Commit and push to a feature branch |
| 65 | +4. Create a pull request |
| 66 | + |
| 67 | +When your PR is merged to `main`: |
| 68 | + |
| 69 | +- The `next` version of the docs will be automatically updated |
| 70 | +- Changes will be visible at `https://mrmans0n.github.io/compose-rules/next/` |
| 71 | + |
| 72 | +When a new release is created: |
| 73 | + |
| 74 | +- A new versioned documentation site is created automatically |
| 75 | +- The `latest` version is updated to point to the new release |
| 76 | + |
| 77 | +## Documentation Guidelines |
| 78 | + |
| 79 | +- Use clear, concise language |
| 80 | +- Include code examples where relevant |
| 81 | +- Link to related rules or sections when applicable |
| 82 | +- Test all code examples to ensure they work |
| 83 | +- Follow the existing documentation structure and style |
| 84 | + |
| 85 | +## Useful Commands |
| 86 | + |
| 87 | +```bash |
| 88 | +# Serve docs locally (fast, no versioning) |
| 89 | +uv run mkdocs serve |
| 90 | + |
| 91 | +# Build the docs (output in site/ directory) |
| 92 | +uv run mkdocs build |
| 93 | + |
| 94 | +# List all deployed versions |
| 95 | +uv run mike list |
| 96 | + |
| 97 | +# Preview versioned docs locally |
| 98 | +uv run mike serve |
| 99 | +``` |
| 100 | + |
| 101 | +## Resources |
| 102 | + |
| 103 | +- [MkDocs Documentation](https://www.mkdocs.org/) |
| 104 | +- [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) |
| 105 | +- [mike Documentation](https://github.com/jimporter/mike) |
| 106 | +- [Markdown Guide](https://www.markdownguide.org/) |
| 107 | + |
| 108 | +## Questions? |
| 109 | + |
| 110 | +If you have questions about the documentation: |
| 111 | + |
| 112 | +- Open an issue on GitHub |
| 113 | +- Reach out to the maintainers |
0 commit comments