Documentation System¶
Overview¶
The Rose documentation is built using MkDocs with the Material theme. It is automatically deployed to Cloudflare Pages on every push to the develop or main branches.
Deployment Environments¶
| Trigger | Git Branch | Environment | Cloudflare Branch | Domain |
|---|---|---|---|---|
| Push | develop |
test | test | docstest.userose.ai |
| Push | main |
production | main | docs.userose.ai |
| Manual dispatch "test" | any | test | test | docstest.userose.ai |
| Manual dispatch "production" | any | production | main | docs.userose.ai |
Local Development¶
Prerequisites¶
- Python 3.11+
- Poetry (installed automatically by bootstrap)
Setup¶
cd docs
# Install dependencies (creates .venv and installs packages)
just install
# Or force reinstall
just install-force
Running Locally¶
The documentation will be available at http://localhost:8001.
Building¶
Manual Deployment¶
You can manually deploy to either environment:
cd docs
# Deploy to test environment (docstest.userose.ai)
just deploy test
# Deploy to production (docs.userose.ai)
just deploy production
Automatic Deployment (CI/CD)¶
The GitHub workflow (.github/workflows/deploy-docs.yml) automatically deploys:
- On push to
develop: Deploys to test environment - On push to
main: Deploys to production environment - Manual trigger: Choose environment from GitHub Actions UI
Workflow Triggers¶
The workflow runs when:
- Files in
docs/**are modified - The workflow file itself is modified
- Manually triggered via
workflow_dispatch
Project Structure¶
docs/
├── src/ # Documentation source files
│ ├── index.md # Home page
│ ├── architecture.md # Architecture overview
│ ├── documentation.md # This file
│ ├── features/ # Feature documentation
│ ├── backend/ # Backend documentation
│ └── frontend/ # Frontend documentation
├── public/ # Static assets
│ ├── _headers # Cloudflare headers config
│ └── _redirects # Cloudflare redirects config
├── mkdocs.yml # MkDocs configuration
├── pyproject.toml # Python dependencies
├── poetry.lock # Locked dependencies
├── justfile # Development commands
└── bootstrap.py # Setup script
Writing Documentation¶
File Format¶
All documentation is written in Markdown with MkDocs extensions:
- Admonitions for callouts (note, warning, tip, etc.)
- Code blocks with syntax highlighting
- Mermaid diagrams for flowcharts and sequences
- Tables for structured data
Adding a New Page¶
- Create a new
.mdfile in the appropriate directory undersrc/ - Add the page to the navigation in
mkdocs.yml - Link to related pages where appropriate
Example: Adding a Feature Doc¶
# 1. Create the file
touch docs/src/features/my-new-feature.md
# 2. Edit mkdocs.yml to add to navigation
# In mkdocs.yml
nav:
- Features:
- Overview: features/index.md
- My New Feature: features/my-new-feature.md # Add this line
Markdown Extensions¶
Admonitions¶
!!! note "Title"
This is a note callout.
!!! warning
This is a warning without a custom title.
!!! tip "Pro Tip"
This is a tip callout.
Title
This is a note callout.
Warning
This is a warning without a custom title.
Pro Tip
This is a tip callout.
Mermaid Diagrams¶
flowchart LR
A[Start] --> B[Process]
B --> C[End]
Code Blocks¶
Tables¶
| Column 1 | Column 2 |
|---|---|
| Value 1 | Value 2 |
Cloudflare Configuration¶
Custom Domains¶
DNS configuration for custom domains:
| Type | Name | Target |
|---|---|---|
| CNAME | docs | rose-docs.pages.dev |
| CNAME | docstest | test.rose-docs.pages.dev |
Headers and Redirects¶
Custom headers and redirects are configured in public/_headers and public/_redirects, which are copied to the build output.