Unverified Commit ece08dc9 authored by Neal Vaidya's avatar Neal Vaidya Committed by GitHub
Browse files

docs: restructure docs directory and move fern config to fern/ (#6700)


Signed-off-by: default avatarNeal Vaidya <nealv@nvidia.com>
Co-authored-by: default avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 1412e44b
...@@ -56,7 +56,7 @@ fi ...@@ -56,7 +56,7 @@ fi
if ! kubectl get pods -n "$NAMESPACE" | grep -q "dynamo-platform"; then if ! kubectl get pods -n "$NAMESPACE" | grep -q "dynamo-platform"; then
warn "Dynamo platform pods not found in namespace $NAMESPACE" warn "Dynamo platform pods not found in namespace $NAMESPACE"
warn "Please ensure Dynamo Kubernetes Platform is installed first:" warn "Please ensure Dynamo Kubernetes Platform is installed first:"
warn " See: docs/pages/kubernetes/installation-guide.md" warn " See: docs/kubernetes/installation-guide.md"
if [[ -z "${FORCE:-}" && -z "${YES:-}" ]]; then if [[ -z "${FORCE:-}" && -z "${YES:-}" ]]; then
read -p "Continue anyway? [y/N]: " -r ans read -p "Continue anyway? [y/N]: " -r ans
[[ "$ans" =~ ^[Yy]$ ]] || exit 1 [[ "$ans" =~ ^[Yy]$ ]] || exit 1
......
...@@ -50,13 +50,13 @@ branch based on `main`). The sync workflow copies changes to ...@@ -50,13 +50,13 @@ branch based on `main`). The sync workflow copies changes to
Three Claude Code skills automate common docs tasks. Invoke them as slash Three Claude Code skills automate common docs tasks. Invoke them as slash
commands in Claude Code (e.g., `/add-dynamo-docs`) — each skill walks through commands in Claude Code (e.g., `/add-dynamo-docs`) — each skill walks through
the full workflow: creating or editing the markdown file, updating the the full workflow: creating or editing the markdown file, updating the
navigation in `docs/versions/dev.yml`, and running `fern check` to validate. navigation in `docs/index.yml`, and running `fern check` to validate.
| Skill | Description | | Skill | Description |
|-------|-------------| |-------|-------------|
| [add-dynamo-docs](/.claude/skills/add-dynamo-docs/SKILL.md) | Add a new page — creates the file with frontmatter, adds the nav entry | | [add-dynamo-docs](https://github.com/ai-dynamo/dynamo/blob/main/.claude/skills/add-dynamo-docs/SKILL.md) | Add a new page — creates the file with frontmatter, adds the nav entry |
| [rm-dynamo-docs](/.claude/skills/rm-dynamo-docs/SKILL.md) | Remove a page — deletes the file, removes the nav entry, checks for broken links | | [rm-dynamo-docs](https://github.com/ai-dynamo/dynamo/blob/main/.claude/skills/rm-dynamo-docs/SKILL.md) | Remove a page — deletes the file, removes the nav entry, checks for broken links |
| [update-dynamo-docs](/.claude/skills/update-dynamo-docs/SKILL.md) | Update a page — edit content, rename, or move between sections | | [update-dynamo-docs](https://github.com/ai-dynamo/dynamo/blob/main/.claude/skills/update-dynamo-docs/SKILL.md) | Update a page — edit content, rename, or move between sections |
--- ---
...@@ -64,10 +64,10 @@ navigation in `docs/versions/dev.yml`, and running `fern check` to validate. ...@@ -64,10 +64,10 @@ navigation in `docs/versions/dev.yml`, and running `fern check` to validate.
The documentation system uses a **dual-branch model**: The documentation system uses a **dual-branch model**:
| Branch | Purpose | Docs directory | | Branch | Purpose | Content | Fern config |
|---|---|---| |---|---|---|---|
| `main` | Source of truth for **dev** (unreleased) documentation | `docs/` | | `main` | Source of truth for **dev** (unreleased) documentation | `docs/` | `fern/` |
| `docs-website` | Published documentation including **all versioned snapshots** | `docs/` | | `docs-website` | Published documentation including **all versioned snapshots** | `fern/pages/` | `fern/` |
Authors edit pages on `main`. A GitHub Actions workflow automatically syncs Authors edit pages on `main`. A GitHub Actions workflow automatically syncs
changes to the `docs-website` branch and publishes them to Fern. The changes to the `docs-website` branch and publishes them to Fern. The
...@@ -86,51 +86,61 @@ bloating the `main` branch with frozen copies of old documentation. ...@@ -86,51 +86,61 @@ bloating the `main` branch with frozen copies of old documentation.
### On `main` ### On `main`
```text ```text
docs/ fern/ # Fern CLI configuration (fern/ is a Fern convention)
├── fern.config.json # Fern org + CLI version pin ├── fern.config.json # Fern org + CLI version pin
├── docs.yml # Site configuration (instances, branding, layout) ├── docs.yml # Site configuration (instances, branding, layout)
├── versions/
│ └── dev.yml # Navigation tree for the dev version
├── pages/ # Markdown content (the actual docs)
│ ├── getting-started/
│ ├── guides/
│ ├── kubernetes/
│ ├── reference/
│ └── ...
├── assets/ # Images, fonts, SVGs, logos
├── components/ ├── components/
│ └── CustomFooter.tsx # React component for the site footer │ └── CustomFooter.tsx # React component for the site footer
├── main.css # Custom CSS (NVIDIA branding, dark mode, etc.) ├── main.css # Custom CSS (NVIDIA branding, dark mode, etc.)
├── convert_callouts.py # GitHub → Fern admonition converter script ├── convert_callouts.py # GitHub → Fern admonition converter script
└── diagrams/ # D2 diagram source files └── .gitignore # Fern-specific ignores
docs/ # Documentation content
├── index.yml # Navigation tree for the dev version
├── getting-started/ # Markdown content (the actual docs)
├── kubernetes/
├── reference/
├── ...
├── assets/ # Images, fonts, SVGs, logos
├── blogs/ # Blog posts
└── diagrams/ # D2 diagram source files
``` ```
### On `docs-website` ### On `docs-website`
The `docs-website` branch mirrors the above structure, plus versioned snapshots: The `docs-website` branch has a different layout optimized for Fern's directory
conventions, plus versioned snapshots:
```text ```text
docs/ fern/
├── docs.yml # Includes the full versions array ├── fern.config.json # Fern org + CLI version pin
├── docs.yml # Includes the full versions array
├── versions/ ├── versions/
│ ├── dev.yml # "Next" / dev navigation (synced from main) │ ├── dev.yml # "Next" / dev navigation (synced from main)
│ ├── v0.8.1.yml # Navigation for v0.8.1 snapshot │ ├── v0.8.1.yml # Navigation for v0.8.1 snapshot
│ └── v0.8.0.yml # Navigation for v0.8.0 snapshot │ └── v0.8.0.yml # Navigation for v0.8.0 snapshot
├── pages/ # Current dev content (synced from main) ├── pages/ # Current dev content (synced from main)
├── pages-v0.8.1/ # Frozen snapshot of pages/ at v0.8.1 ├── pages-v0.8.1/ # Frozen snapshot of pages/ at v0.8.1
├── pages-v0.8.0/ # Frozen snapshot of pages/ at v0.8.0 ├── pages-v0.8.0/ # Frozen snapshot of pages/ at v0.8.0
└── ... # (other files same as main) ├── components/ # React components
├── main.css # Custom CSS
├── convert_callouts.py # Callout converter
├── blogs/ # Blog posts (synced from main)
└── assets/ # Images, fonts, SVGs
``` ```
Each `pages-vX.Y.Z/` directory is an immutable copy of `pages/` taken at Each `pages-vX.Y.Z/` directory is an immutable copy of `pages/` taken at
release time. The corresponding `versions/vX.Y.Z.yml` file is a copy of release time. The corresponding `versions/vX.Y.Z.yml` file is a copy of
`dev.yml` with all `../pages/` paths rewritten to `../pages-vX.Y.Z/`. `dev.yml` with all `../pages/` paths rewritten to `../pages-vX.Y.Z/`.
The sync workflow copies content from `main`'s `docs/` into `fern/pages/` and
transforms navigation paths in `index.yml``versions/dev.yml` accordingly.
--- ---
## Configuration Files ## Configuration Files
### `fern.config.json` ### `fern/fern.config.json`
```json ```json
{ {
...@@ -142,7 +152,7 @@ release time. The corresponding `versions/vX.Y.Z.yml` file is a copy of ...@@ -142,7 +152,7 @@ release time. The corresponding `versions/vX.Y.Z.yml` file is a copy of
- **organization**: The Fern organization that owns the docs site. - **organization**: The Fern organization that owns the docs site.
- **version**: Pins the Fern CLI version used for generation. - **version**: Pins the Fern CLI version used for generation.
### `docs.yml` ### `fern/docs.yml`
This is the main Fern site configuration. Key sections: This is the main Fern site configuration. Key sections:
...@@ -164,7 +174,7 @@ This is the main Fern site configuration. Key sections: ...@@ -164,7 +174,7 @@ This is the main Fern site configuration. Key sections:
The sync workflow preserves the versions array from `docs-website` when copying The sync workflow preserves the versions array from `docs-website` when copying
`docs.yml` from `main`. `docs.yml` from `main`.
### `versions/dev.yml` ### `docs/index.yml`
Defines the navigation tree — the sidebar structure of the docs site. Each Defines the navigation tree — the sidebar structure of the docs site. Each
entry maps a page title to a markdown file path: entry maps a page title to a markdown file path:
...@@ -174,13 +184,18 @@ navigation: ...@@ -174,13 +184,18 @@ navigation:
- section: Getting Started - section: Getting Started
contents: contents:
- page: Quickstart - page: Quickstart
path: ../pages/getting-started/quickstart.md path: getting-started/quickstart.md
- page: Support Matrix - page: Support Matrix
path: ../pages/reference/support-matrix.md path: reference/support-matrix.md
``` ```
Sections can be nested. Pages can be marked as `hidden: true` to make them Paths are relative to the `docs/` directory. Sections can be nested. Pages can
accessible by URL but invisible in the sidebar. be marked as `hidden: true` to make them accessible by URL but invisible in the
sidebar.
During sync to `docs-website`, the workflow copies `index.yml` to
`fern/versions/dev.yml` and transforms paths (e.g., `getting-started/X`
`../pages/getting-started/X`) to match the docs-website directory layout.
--- ---
...@@ -210,23 +225,17 @@ publishing. It runs three jobs depending on the trigger: ...@@ -210,23 +225,17 @@ publishing. It runs three jobs depending on the trigger:
**Steps:** **Steps:**
1. Checks out both `main` and `docs-website` branches side-by-side 1. Checks out both `main` and `docs-website` branches side-by-side
2. Copies from `main``docs-website`: 2. Copies content from `main`'s `docs/``docs-website`'s `fern/pages/`
- `docs/pages/` — all markdown content 3. Copies `docs/index.yml``fern/versions/dev.yml` and transforms paths
- `docs/versions/dev.yml` — navigation structure for the docs-website layout using `yq`
- `docs/assets/` — images, fonts, SVGs 4. Syncs assets from `docs/assets/` and blogs from `docs/blogs/`
- `docs/fern.config.json` — Fern config 5. Copies Fern config files from `fern/` → docs-website's `fern/`
- `docs/components/` — React components (`fern.config.json`, `components/`, `main.css`, `convert_callouts.py`)
- `docs/main.css` — custom styles 6. Runs `convert_callouts.py` to transform GitHub-style callouts to Fern format
- `docs/convert_callouts.py` — conversion script 7. Updates `docs.yml` from `main` **while preserving the versions array** from
3. Runs `convert_callouts.py` to transform GitHub-style callouts to Fern format
4. Updates `docs.yml` from `main` **while preserving the versions array** from
`docs-website` (uses `yq` to save/restore the versions list) `docs-website` (uses `yq` to save/restore the versions list)
5. Commits and pushes to `docs-website` 8. Commits and pushes to `docs-website`
6. Publishes to Fern via `fern generate --docs` 9. Publishes to Fern via `fern generate --docs`
**Symlink trick:** The Fern CLI expects a `fern/` directory. Since docs live in
`docs/`, the workflow creates a symlink `docs/fern → docs/.` (i.e., pointing to
itself) so Fern can find its config files.
#### Job 3: Version Release (tags) #### Job 3: Version Release (tags)
...@@ -236,14 +245,14 @@ manual `workflow_dispatch` with a tag specified. ...@@ -236,14 +245,14 @@ manual `workflow_dispatch` with a tag specified.
**Steps:** **Steps:**
1. Validates tag format (must be exactly `vX.Y.Z`, no suffixes like `-rc1`) 1. Validates tag format (must be exactly `vX.Y.Z`, no suffixes like `-rc1`)
2. Checks that the version doesn't already exist (no duplicate snapshots) 2. Checks that the version doesn't already exist (no duplicate snapshots)
3. Creates `docs/pages-vX.Y.Z/` by copying `docs/pages/` 3. Creates `fern/pages-vX.Y.Z/` by copying `fern/pages/`
4. Rewrites GitHub links in the snapshot: 4. Rewrites GitHub links in the snapshot:
- `github.com/ai-dynamo/dynamo/tree/main``tree/vX.Y.Z` - `github.com/ai-dynamo/dynamo/tree/main``tree/vX.Y.Z`
- `github.com/ai-dynamo/dynamo/blob/main``blob/vX.Y.Z` - `github.com/ai-dynamo/dynamo/blob/main``blob/vX.Y.Z`
5. Runs `convert_callouts.py` on the snapshot 5. Runs `convert_callouts.py` on the snapshot
6. Creates `docs/versions/vX.Y.Z.yml` from `dev.yml` with paths updated to 6. Creates `fern/versions/vX.Y.Z.yml` from `dev.yml` with paths updated to
`../pages-vX.Y.Z/` `../pages-vX.Y.Z/`
7. Updates `docs.yml`: 7. Updates `fern/docs.yml`:
- Inserts new version right after the "dev" entry - Inserts new version right after the "dev" entry
- Sets the product's default `path` to the new version - Sets the product's default `path` to the new version
- Updates the "Latest" display-name to `"Latest (vX.Y.Z)"` - Updates the "Latest" display-name to `"Latest (vX.Y.Z)"`
...@@ -273,9 +282,9 @@ Runs two independent link-checking jobs: ...@@ -273,9 +282,9 @@ Runs two independent link-checking jobs:
### Writing docs on `main` ### Writing docs on `main`
1. Edit or add markdown files in `docs/pages/`. 1. Edit or add markdown files in `docs/`.
2. If adding a new page, add an entry in `docs/versions/dev.yml` to make it 2. If adding a new page, add an entry in `docs/index.yml` to make it appear
appear in the sidebar navigation. in the sidebar navigation.
3. Use standard GitHub-flavored markdown. Callouts (admonitions) should use 3. Use standard GitHub-flavored markdown. Callouts (admonitions) should use
GitHub's native syntax — they are automatically converted during sync: GitHub's native syntax — they are automatically converted during sync:
```markdown ```markdown
...@@ -300,14 +309,14 @@ markdown files: ...@@ -300,14 +309,14 @@ markdown files:
### Custom components ### Custom components
React components in `docs/components/` can be used in markdown via MDX. The React components in `fern/components/` can be used in markdown via MDX. The
`CustomFooter.tsx` renders the NVIDIA footer with legal links and branding. `CustomFooter.tsx` renders the NVIDIA footer with legal links and branding.
--- ---
## Callout Conversion ## Callout Conversion
The `docs/convert_callouts.py` script bridges the gap between GitHub-flavored The `fern/convert_callouts.py` script bridges the gap between GitHub-flavored
markdown and Fern's admonition format. This lets authors use GitHub's native markdown and Fern's admonition format. This lets authors use GitHub's native
callout syntax on `main` while Fern gets its required component format. callout syntax on `main` while Fern gets its required component format.
...@@ -325,13 +334,13 @@ callout syntax on `main` while Fern gets its required component format. ...@@ -325,13 +334,13 @@ callout syntax on `main` while Fern gets its required component format.
```bash ```bash
# Convert all files in a directory (recursive, in-place) # Convert all files in a directory (recursive, in-place)
python convert_callouts.py --dir docs/pages python fern/convert_callouts.py --dir docs/
# Convert a single file # Convert a single file
python convert_callouts.py input.md output.md python fern/convert_callouts.py input.md output.md
# Run built-in tests # Run built-in tests
python convert_callouts.py --test python fern/convert_callouts.py --test
``` ```
The conversion happens automatically during the sync-dev and release-version The conversion happens automatically during the sync-dev and release-version
...@@ -353,28 +362,12 @@ Install the Fern CLI globally via npm: ...@@ -353,28 +362,12 @@ Install the Fern CLI globally via npm:
npm install -g fern-api npm install -g fern-api
``` ```
### Create the `fern` symlink
The Fern CLI requires its configuration files to live inside a directory called
`fern/`. In this repo the docs live in `docs/`, so you need to create a symlink
that points `fern` back to the same directory:
```bash
cd docs
ln -s . fern
```
This makes the CLI find `fern/fern.config.json`, `fern/docs.yml`, etc. without
moving any files. The symlink is listed in `.gitignore` and should not be
committed.
### Validate configuration ### Validate configuration
Run `fern check` to validate that `docs.yml`, `fern.config.json`, and the Run `fern check` from the repo root to validate that `fern/docs.yml`,
navigation files are syntactically correct: `fern/fern.config.json`, and the navigation files are syntactically correct:
```bash ```bash
cd docs
fern check fern check
``` ```
...@@ -384,7 +377,6 @@ Use `fern docs broken-links` to scan all pages for internal links that don't ...@@ -384,7 +377,6 @@ Use `fern docs broken-links` to scan all pages for internal links that don't
resolve: resolve:
```bash ```bash
cd docs
fern docs broken-links fern docs broken-links
``` ```
...@@ -395,7 +387,6 @@ This is the same check that runs in CI on every pull request. ...@@ -395,7 +387,6 @@ This is the same check that runs in CI on every pull request.
Run `fern docs dev` to build the site and serve it locally with hot-reload: Run `fern docs dev` to build the site and serve it locally with hot-reload:
```bash ```bash
cd docs
fern docs dev fern docs dev
``` ```
...@@ -410,12 +401,12 @@ including navigation, version dropdowns, and custom styling. ...@@ -410,12 +401,12 @@ including navigation, version dropdowns, and custom styling.
The Fern site supports a version dropdown in the UI. Each version is defined by: The Fern site supports a version dropdown in the UI. Each version is defined by:
1. **A navigation file** (`docs/versions/vX.Y.Z.yml`) — sidebar structure 1. **A navigation file** (`fern/versions/vX.Y.Z.yml`) — sidebar structure
pointing to version-specific pages. pointing to version-specific pages (on the `docs-website` branch).
2. **A pages directory** (`docs/pages-vX.Y.Z/`) — frozen snapshot of the 2. **A pages directory** (`fern/pages-vX.Y.Z/`) — frozen snapshot of the
markdown content at release time. markdown content at release time (on the `docs-website` branch).
3. **An entry in `docs.yml`** — tells Fern about the version's display name, 3. **An entry in `fern/docs.yml`** — tells Fern about the version's display
slug, and config path. name, slug, and config path.
### Version types ### Version types
...@@ -460,11 +451,12 @@ automatically. ...@@ -460,11 +451,12 @@ automatically.
│ │ │ │ │ │
│ ▼ │ │ ▼ │
│ sync-dev job: │ │ sync-dev job: │
│ 1. Copy docs/pages/, assets/, configs → docs-website branch │ │ 1. Copy docs/ content → fern/pages/ on docs-website branch │
│ 2. Convert GitHub callouts → Fern admonitions │ │ 2. Copy fern/ configs → fern/ on docs-website branch │
│ 3. Preserve version list from docs-website's docs.yml │ │ 3. Convert GitHub callouts → Fern admonitions │
│ 4. Commit + push to docs-website │ │ 4. Preserve version list from docs-website's docs.yml │
│ 5. fern generate --docs (publishes to Fern) │ │ 5. Commit + push to docs-website │
│ 6. fern generate --docs (publishes to Fern) │
│ │ │ │ │ │
│ ▼ │ │ ▼ │
│ Live on docs.dynamo.nvidia.com/dynamo/dev/ within minutes │ │ Live on docs.dynamo.nvidia.com/dynamo/dev/ within minutes │
...@@ -479,11 +471,11 @@ automatically. ...@@ -479,11 +471,11 @@ automatically.
│ release-version job: │ │ release-version job: │
│ 1. Validate tag format (vX.Y.Z only) │ │ 1. Validate tag format (vX.Y.Z only) │
│ 2. Check version doesn't already exist │ │ 2. Check version doesn't already exist │
│ 3. Snapshot pages/ → pages-vX.Y.Z/ │ 3. Snapshot fern/pages/ → fern/pages-vX.Y.Z/ │
│ 4. Rewrite GitHub links (tree/main → tree/vX.Y.Z) │ │ 4. Rewrite GitHub links (tree/main → tree/vX.Y.Z) │
│ 5. Convert callouts in snapshot │ │ 5. Convert callouts in snapshot │
│ 6. Create versions/vX.Y.Z.yml (paths → pages-vX.Y.Z/) │ 6. Create fern/versions/vX.Y.Z.yml (paths → pages-vX.Y.Z/) │
│ 7. Update docs.yml (insert version, set as default) │ 7. Update fern/docs.yml (insert version, set as default) │
│ 8. Commit + push to docs-website │ │ 8. Commit + push to docs-website │
│ 9. fern generate --docs (publishes to Fern) │ │ 9. fern generate --docs (publishes to Fern) │
│ │ │ │ │ │
...@@ -504,17 +496,16 @@ automatically. ...@@ -504,17 +496,16 @@ automatically.
### Update existing documentation ### Update existing documentation
1. Edit files in `docs/pages/` on a feature branch. 1. Edit files in `docs/` on a feature branch.
2. If adding a new page, add its entry in `docs/versions/dev.yml`. 2. If adding a new page, add its entry in `docs/index.yml`.
3. Open a PR — linting runs automatically. 3. Open a PR — linting runs automatically.
4. Merge — sync + publish happens automatically. 4. Merge — sync + publish happens automatically.
### Add a new top-level section ### Add a new top-level section
1. Create a directory under `docs/pages/` (e.g., `docs/pages/new-section/`). 1. Create a directory under `docs/` (e.g., `docs/new-section/`).
2. Add markdown files for each page. 2. Add markdown files for each page.
3. Add a new `- section:` block in `docs/versions/dev.yml` with the desired 3. Add a new `- section:` block in `docs/index.yml` with the desired hierarchy.
hierarchy.
### Release versioned documentation ### Release versioned documentation
...@@ -537,7 +528,7 @@ Go to **Actions → Fern Docs → Run workflow**: ...@@ -537,7 +528,7 @@ Go to **Actions → Fern Docs → Run workflow**:
1. Check the **Actions** tab for the failed `Fern Docs` workflow run. 1. Check the **Actions** tab for the failed `Fern Docs` workflow run.
2. Common issues: 2. Common issues:
- **Broken links:** Fix the links flagged by `fern docs broken-links`. - **Broken links:** Fix the links flagged by `fern docs broken-links`.
- **Invalid YAML:** Check `docs.yml` or `versions/dev.yml` syntax. - **Invalid YAML:** Check `fern/docs.yml` or `docs/index.yml` syntax.
- **Expired `FERN_TOKEN`:** Rotate the token in repo secrets. - **Expired `FERN_TOKEN`:** Rotate the token in repo secrets.
- **Duplicate version:** The tag was already released; check `docs-website` - **Duplicate version:** The tag was already released; check `docs-website`
for existing `pages-vX.Y.Z/` directory. for existing `fern/pages-vX.Y.Z/` directory.
...@@ -240,7 +240,7 @@ dynamo-frontend: http-request (root) ...@@ -240,7 +240,7 @@ dynamo-frontend: http-request (root)
dispatch dispatch
``` ```
![End-to-end trace in Grafana Tempo showing frontend, KV router, worker, and SGLang engine spans](../../../assets/img/sglang-trace.png) ![End-to-end trace in Grafana Tempo showing frontend, KV router, worker, and SGLang engine spans](../../assets/img/sglang-trace.png)
### Viewing Traces ### Viewing Traces
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment