Skip to content

Commit 28b4d07

Browse files
committed
Enhance README and guide generator to support nested directories for dynamic guides
- Updated README.md to include instructions for configuring remote guides from nested directories, detailing the use of `targetFilename` for top-level page generation. - Modified guide-generator.js to add new dynamic guides for 'Prefix Cache Storage' and 'Prefix Cache Storage - CPU', including sidebar positions and descriptions. Signed-off-by: Pete Cheslock <[email protected]>
1 parent b162863 commit 28b4d07

File tree

2 files changed

+63
-12
lines changed

2 files changed

+63
-12
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,55 @@ git push # Triggers automatic deployment
9797
- Component descriptions and version tags
9898
- **Components** sync from their individual release tags
9999
- **Guides** sync from the llm-d/llm-d release tag
100+
- **Architecture docs** sync from the llm-d/llm-d release tag
100101
- **Community docs** always sync from `main` branch (latest)
101102

103+
### Understanding Versioned vs. Always-Current Content
104+
105+
The remote content system supports two sync strategies:
106+
107+
**Versioned Content** (syncs from release tags):
108+
- **Guides** (`docs/guide/`) - Uses `RELEASE_INFO.version` from `components-data.yaml`
109+
- **Architecture** (`docs/architecture/`) - Uses `RELEASE_INFO.version` from `components-data.yaml`
110+
- **Components** (`docs/architecture/Components/`) - Each component uses its own `version` field from `components-data.yaml`
111+
- **Infrastructure Providers** (`docs/guide/InfraProviders/`) - Uses `RELEASE_INFO.version` from `components-data.yaml`
112+
113+
These docs are pinned to specific release tags (e.g., `v0.3.1`) to ensure documentation matches the released code. When you update `release.version` in `components-data.yaml`, all versioned content automatically syncs from the new tag.
114+
115+
**Always-Current Content** (syncs from `main` branch):
116+
- **Community docs** (`docs/community/`) - Contributing guidelines, Code of Conduct, Security Policy, SIGs
117+
- These are configured via `COMMON_REPO_CONFIGS['llm-d-main'].branch = 'main'` in `component-configs.js`
118+
119+
Community documentation stays current with the latest policies and processes, independent of releases. The `branch` field in `COMMON_REPO_CONFIGS` controls this behavior.
120+
121+
**How it works:**
122+
- `generateRepoUrls()` in `component-configs.js` prefers `version` over `branch` when both exist
123+
- Versioned content sources call `findRepoConfig('llm-d')` and use `RELEASE_INFO.version`
124+
- Community sources call `findRepoConfig('llm-d')` and use `repoConfig.branch` (which is `'main'`)
125+
- This separation lets you cut releases without worrying about stale community policies
126+
102127
### Testing content from a feature branch
103128

104129
To preview remote docs from a work-in-progress branch (for example `liu-cong-debug`), temporarily set `release.version` in `remote-content/remote-sources/components-data.yaml` to that branch name. Run `npm start` or `npm run build` to pull the branch content into the site. When testing is done, change `release.version` back to the released tag so production remains on the official docs.
105130

131+
### Supporting remote guides from nested directories
132+
133+
Dynamic guides are configured in `remote-content/remote-sources/guide/guide-generator.js`. Each entry in `DYNAMIC_GUIDES` points at a `README.md` inside `guides/<dirName>/` in the main repo. By default, the generator mirrors the directory structure when it creates docs: `dirName: 'some-folder/sub-guide'` produces `some-folder/sub-guide.md` under `docs/guide/Installation`, and the sidebar groups pages under a folder.
134+
135+
If you want to surface a nested source as a top-level page, add an optional `targetFilename` to the guide definition. Example:
136+
137+
```javascript
138+
{
139+
dirName: 'prefix-cache-storage/cpu',
140+
title: 'Prefix Cache Storage - CPU',
141+
description: '',
142+
sidebarPosition: 5,
143+
targetFilename: 'prefix-cache-storage-cpu.md'
144+
}
145+
```
146+
147+
With `targetFilename`, the generator still reads `guides/prefix-cache-storage/cpu/README.md`, but it writes the output to `docs/guide/Installation/prefix-cache-storage-cpu.md`, letting the page appear alongside other top-level guides. Leave `targetFilename` out to keep the default nested behavior.
148+
106149
**Manual updates:** You can also manually edit `components-data.yaml` if needed.
107150

108151
### Adding New Components

remote-content/remote-sources/guide/guide-generator.js

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,36 +73,43 @@ const DYNAMIC_GUIDES = [
7373
description: 'Well-lit path for intelligent inference scheduling with load balancing',
7474
sidebarPosition: 3
7575
},
76+
{
77+
dirName: 'prefix-cache-storage',
78+
title: 'Prefix Cache Storage',
79+
description: 'Well-lit path for separating prefill and decode operations',
80+
sidebarPosition: 4
81+
},
82+
{
83+
dirName: 'prefix-cache-storage/cpu',
84+
title: 'Prefix Cache Storage - CPU',
85+
description: 'Well-lit path for separating prefill and decode operations',
86+
sidebarPosition: 5,
87+
targetFilename: 'prefix-cache-storage-cpu.md'
88+
},
7689
{
7790
dirName: 'pd-disaggregation',
7891
title: 'Prefill/Decode Disaggregation',
7992
description: 'Well-lit path for separating prefill and decode operations',
80-
sidebarPosition: 4
93+
sidebarPosition: 6
8194
},
8295
{
8396
dirName: 'precise-prefix-cache-aware',
8497
title: 'Precise Prefix Cache Aware Routing',
8598
description: 'Feature guide for precise prefix cache aware routing',
86-
sidebarPosition: 5
99+
sidebarPosition: 7
87100
},
88101
{
89102
dirName: 'wide-ep-lws',
90103
title: 'Wide Expert Parallelism with LeaderWorkerSet',
91104
description: 'Well-lit path for wide expert parallelism using LeaderWorkerSet',
92-
sidebarPosition: 6
105+
sidebarPosition: 8
93106
},
94107
{
95108
dirName: 'simulated-accelerators',
96109
title: 'Accelerator Simulation',
97110
description: 'Feature guide for llm-d accelerator simulation',
98-
sidebarPosition: 7
99-
},
100-
{
101-
dirName: 'predicted-latency-based-scheduling',
102-
title: 'Predicted Latency Based Load Balancing',
103-
description: 'Well-lit path for predicted latency based load balancing',
104-
sidebarPosition: 8
105-
},
111+
sidebarPosition: 9
112+
}
106113
];
107114

108115
/**
@@ -147,6 +154,7 @@ function createGuidePlugins() {
147154
// Add dynamic guides
148155
DYNAMIC_GUIDES.forEach((guide) => {
149156
const sourceFile = `guides/${guide.dirName}/README.md`;
157+
const targetFilename = guide.targetFilename || `${guide.dirName}.md`;
150158

151159
plugins.push([
152160
'docusaurus-plugin-remote-content',
@@ -166,7 +174,7 @@ function createGuidePlugins() {
166174
sidebarLabel: guide.title,
167175
sidebarPosition: guide.sidebarPosition,
168176
filename: sourceFile,
169-
newFilename: `${guide.dirName}.md`,
177+
newFilename: targetFilename,
170178
repoUrl,
171179
branch: releaseVersion,
172180
content,

0 commit comments

Comments
 (0)