MIGRATION_GUIDE.md 6.17 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
---
orphan: true
---

# Documentation Migration Guide

This guide covers migrating Dynamo documentation to the new 9-category hierarchy.

---

## Directory Hierarchy

Documentation is organized into 9 top-level categories:

```
docs/
├── components/          # Router, Planner, KVBM, Frontend, Profiler
├── backends/            # vLLM, SGLang, TRT-LLM
├── features/            # Multimodal, LoRA, Speculative Decoding
├── deploy/              # Kubernetes, Helm, Operator
├── performance/         # Tuning, Benchmarks
├── infrastructure/      # Observability, Fault Tolerance, Development
├── integrations/        # LMCache, HiCache, NIXL
├── reference/           # CLI, Glossary, Support Matrix
└── design_docs/         # Tier 3 design documents
```

---

## Category Reference

| Category | Location | Content Type |
|----------|----------|--------------|
| **Components** | `docs/components/<name>/` | Standalone deployable services (Router, Planner, KVBM, Frontend, Profiler) |
| **Backends** | `docs/backends/<name>/` | LLM inference engine integrations (vLLM, SGLang, TRT-LLM) |
| **Features** | `docs/features/<name>/` | Cross-cutting capabilities (Multimodal, LoRA, Speculative Decoding) |
| **Deploy** | `docs/deploy/` | Kubernetes deployment, operator, Helm charts |
| **Performance** | `docs/performance/` | Performance tuning, benchmarking, profiling |
| **Infrastructure** | `docs/infrastructure/<topic>/` | Observability, fault tolerance, development guides |
| **Integrations** | `docs/integrations/<name>/` | External tool integrations (LMCache, HiCache, NIXL) |
| **Reference** | `docs/reference/` | CLI reference, glossary, support matrix |
| **Design** | `docs/design_docs/` | Architecture and algorithm documentation (Tier 3) |

---

## Three-Tier Pattern

Components and backends follow a three-tier documentation pattern:

| Tier | Location | Purpose | Audience |
|------|----------|---------|----------|
| **Tier 1** | `components/src/dynamo/<name>/README.md` | Redirect stub (5 lines) | Developers browsing code |
| **Tier 2** | `docs/<category>/<name>/` | User documentation | Users, operators |
| **Tier 3** | `docs/design_docs/<name>_design.md` | Design documentation | Contributors |

---

## Link Update Checklist

When moving documentation, update links in these locations:

### 1. Internal Markdown Links

Find files linking to the old path:

```bash
# Find all files with links to old path
rg -l "docs/old_path" docs/ fern/

# Find relative markdown links
rg "\]\(.*old_path" docs/
```

### 2. Sphinx Configuration

**Files to update:**

| File | Content |
|------|---------|
| `docs/index.rst` | Main toctree with section references |
| `docs/_sections/*.rst` | Section toctrees (8 files) |
| `docs/hidden_toctree.rst` | Orphaned pages not in main nav |
| `docs/conf.py` | Redirects mapping (lines 40-98) |

**Toctree syntax:**
```rst
.. toctree::
   :hidden:

   Page Title <../new/path/file>
```

**Add redirect in conf.py:**
```python
redirects = {
    "old/path/file": "../new/path/file.html",
}
```

### 3. Fern Configuration

**Files to update:**

| File | Content |
|------|---------|
| `fern/docs.yml` | Site config and version reference |
| `fern/versions/next.yml` | Full navigation structure |

**Navigation syntax:**
```yaml
- page: Page Title
  path: ../pages/new/path.md
```

**Move files in `fern/pages/` to match new structure.**

### 4. RST Cross-References

Find and update:
```rst
:doc:`../old/path/file`
```

### 5. Include Directives

Check `docs/_includes/` for includes:
```rst
.. include:: ../old/path/file.rst
```

---

133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
## Pre-Migration Link Validation

Before migrating, validate source docs to avoid carrying over broken links.

### Pre-flight Broken Link Check

```bash
# Install lychee (if not available)
cargo install lychee   # or: brew install lychee

# Check source files (example: migrating kvbm docs)
lychee docs/kvbm/ --offline --exclude-path docs/_build

# Or use the full check with external URLs
lychee docs/kvbm/ --exclude-path docs/_build
```

If lychee is unavailable, use ripgrep to find potentially broken links:

```bash
# Find all internal markdown links and spot-check targets
rg -n '\]\([^http][^)]*\.md' docs/kvbm/
```

### Golden Rule

**Only link to files that exist.** Before adding any link:

1. Verify the target file exists at the expected path
2. Test the relative path calculation (count `../` correctly)
3. For cross-section links, consider using the cross-reference path table

### Post-Migration Validation

After moving files, run link check again to catch broken references:

```bash
# Check all docs after migration
lychee docs/ --offline --exclude-path docs/_build

# Check specific migrated directory (example: after moving to components/kvbm)
lychee docs/components/kvbm/ --offline
```

---

179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
## Style Editing Guidelines

After migrating content, review for FLOW, STYLE, and CONSISTENCY.

**Do NOT change content meaning - only improve presentation.**

### FLOW Rules

| Rule | Description |
|------|-------------|
| Lead with the point (BLUF) | First paragraph states what the doc covers |
| Logical section order | Overview → Setup → Usage → Troubleshooting |
| One idea per paragraph | Split paragraphs with multiple topics |
| No orphaned sentences | Avoid single sentences between sections |

### STYLE Rules

| Rule | Example |
|------|---------|
| Active voice for instructions | "Run the command" not "The command should be run" |
| Consistent tense | All steps in present tense |
| No redundant phrases | "To" not "In order to" |
| Short sentences | Target ≤25 words |

### CONSISTENCY Rules

| Rule | Standard |
|------|----------|
| Component names | vLLM, SGLang, TensorRT-LLM (or TRT-LLM) |
| Status indicators | ✅ Supported, 🚧 Experimental, ❌ Not Supported |
| Heading hierarchy | # → ## → ### (no skips) |
| Code block languages | Always specify (```python, ```bash, ```yaml) |

---

## Related Files

- [SOURCE_TARGET_MAPPING.md](SOURCE_TARGET_MAPPING.md) - Comprehensive file-level source → target mapping
- [README.md](README.md) - Template overview and selection guide
- [EXAMPLE_SKILL.md](EXAMPLE_SKILL.md) - Cursor skill for AI-assisted migration
- Individual templates: `component_readme.md`, `component_guide.md`, etc.