Skip to content

Commit e9a3363

Browse files
authored
docs: switch over to fern (#123)
#### Overview Switch the documentation site from Sphinx to Fern and migrate the docs content, navigation, and API reference generation to the Fern structure. - [x] I confirm this contribution is my own work, or I have the right to submit it under this project's license. - [x] I searched existing issues and open pull requests, and this does not duplicate existing work. #### Details - Adds Fern site configuration, NVIDIA assets, shared Fern components, and site styling. - Migrates docs pages from the previous Markdown/Sphinx layout to MDX/Fern paths, including getting started, concepts, integrations, plugin docs, reference, resources, and troubleshooting content. - Replaces Sphinx-oriented API reference generation with Fern-friendly Python, Node.js, and Rust reference generation scripts. - Updates docs build scripts, CI docs workflows, path filters, pre-commit hooks, package metadata, lockfiles, attributions, and contribution/release guidance for the Fern workflow. - Validated with `just docs`, `just docs-linkcheck`, and `uv run pre-commit run --all-files`; the Fern checks pass with one light-mode accent contrast warning reported by Fern. #### Where should the reviewer start? Start with `fern/docs.yml` and `scripts/build-docs.sh` to understand the new docs entry points and navigation, then sample the migration pattern in `docs/index.yml` and `docs/getting-started/quick-start/index.mdx`. #### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to) - Relates to #71 ## Summary by CodeRabbit * **New Features** * Added Fern-based documentation site configuration with custom React components * Added API reference generation scripts for Python, Node.js, and Rust libraries * **Documentation** * Migrated documentation from Sphinx to Fern using MDX format with updated structure and navigation * Converted all pages to use MDX frontmatter, updated internal links to absolute routes, and standardized SPDX headers * **Refactor** * Removed Sphinx build infrastructure and replaced with Fern validation workflow * Updated CI/CD to publish docs via Fern instead of GitHub Pages * **Chores** * Updated .gitignore, pre-commit hooks, and CI path filters for Fern docs structure * Updated copyright checking script to support MDX files [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/NVIDIA/NeMo-Relay/pull/123?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) Authors: - Will Killian (https://github.com/willkill07) Approvers: - https://github.com/Salonijain27 URL: #123
1 parent a550c28 commit e9a3363

137 files changed

Lines changed: 6328 additions & 9312 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/contribute-docs/SKILL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,17 @@ Use this skill for docs-only or example-heavy changes.
2626
- Keep stable user-facing wrappers at `scripts/` root in docs and examples;
2727
only point at namespaced helper paths when documenting internal maintenance
2828
work
29+
- In MDX files, top-of-file comments must use JSX comment delimiters:
30+
`{/*` to open and `*/}` to close. Do not use HTML comments for MDX SPDX
31+
headers.
2932

3033
## Checklist
3134

3235
- [ ] `README.md` or `docs/index.md` updated when entry points changed
3336
- [ ] Relevant getting-started or reference docs updated
3437
- [ ] Example commands still match current package names and paths
3538
- [ ] Relevant package or crate `README.md` files updated when examples or binding guidance changed
39+
- [ ] New or regenerated MDX files use `{/* ... */}` for top-of-file SPDX comments
3640
- [ ] Release-policy docs still point to GitHub Releases as the only release-history source of truth
3741
- [ ] Run `just docs` when the docs site changed; `./scripts/build-docs.sh html` remains the compatibility wrapper
3842

.agents/skills/review-doc-style/SKILL.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ Treat these as blocking issues:
4747
- A doc claims support for a binding, feature, or workflow that the repo no longer provides
4848
- Examples or procedures are likely to fail as written
4949
- User-facing naming is inconsistent with current repo terminology
50+
- MDX top-of-file SPDX comments use HTML comment delimiters instead of
51+
`{/* ... */}`
5052
- NVIDIA is not capitalized correctly
5153
- Code, commands, paths, or filenames are not formatted as inline code where needed
5254

@@ -71,6 +73,7 @@ Flag these when they materially improve clarity or consistency:
7173
- **Voice**: Prefer active voice, present tense, short sentences, and plain English.
7274
- **Links**: Use descriptive anchor text, not bare URLs or weak labels.
7375
- **Formatting**: Commands, code elements, expressions, file names, and paths are monospace.
76+
- **MDX headers**: Top-of-file MDX SPDX comments use `{/*` and `*/}` delimiters.
7477
- **Procedures**: Steps are easy to scan, imperative, and split into smaller tasks when long.
7578
- **Examples**: Code blocks are introduced by full sentences and match current APIs and build commands.
7679
- **Terminology**: Use consistent terms throughout the document.

.github/ISSUE_TEMPLATE/03-documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ body:
4040
description: Link to pages or list file paths. Enter N/A if you are not sure.
4141
placeholder: |
4242
- https://...
43-
- docs/...
43+
- fern/... or docs/...
4444
validations: {required: true}
4545
- type: textarea
4646
id: proposed_change

.github/ci-path-filters.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,18 @@ dependencies:
111111
docs:
112112
- 'CONTRIBUTING.md'
113113
- 'README.md'
114+
- 'docs/**'
115+
- 'Cargo.lock'
116+
- 'Cargo.toml'
114117
- 'crates/adaptive/src/**'
115118
- 'crates/core/src/**'
119+
- 'crates/ffi/src/**'
116120
- 'crates/node/*.d.ts'
117121
- 'crates/node/*.js'
122+
- 'crates/node/package.json'
123+
- 'crates/*/Cargo.toml'
118124
- 'crates/**/*.md'
119-
- 'docs/**'
125+
- 'fern/**'
120126
- 'integrations/coding-agents/**'
121127
- 'python/nemo_relay/**'
122128
- 'scripts/build-docs.sh'

.github/workflows/ci.yaml

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
&& !cancelled()
3030
&& needs.prepare.result == 'success'
3131
&& needs.ci_required.result == 'success'
32-
&& needs.prepare.outputs.publish_docs != 'true'
3332
}}
3433
permissions:
3534
contents: read
@@ -74,22 +73,17 @@ jobs:
7473
run: |
7574
set -euo pipefail
7675
full_ci=false
77-
publish_docs=false
7876
publish_packages=false
7977
8078
if [[ "$REF_TYPE" == "tag" || "$REF_NAME" == "$DEFAULT_BRANCH" ]]; then
8179
full_ci=true
8280
fi
83-
if [[ "$REF_TYPE" == "tag" ]]; then
84-
publish_docs=true
85-
fi
8681
if [[ "$REF_TYPE" == "tag" && ! "$REF_NAME" =~ -alpha\.[0-9]+$ ]]; then
8782
publish_packages=true
8883
fi
8984
9085
{
9186
printf 'full_ci=%s\n' "$full_ci"
92-
printf 'publish_docs=%s\n' "$publish_docs"
9387
printf 'publish_packages=%s\n' "$publish_packages"
9488
} >> "$GITHUB_OUTPUT"
9589
@@ -98,7 +92,6 @@ jobs:
9892
is_pr: ${{ startsWith(github.ref_name, 'pull-request/') }}
9993
is_main_branch: ${{ github.ref_name == 'main' }}
10094
has_skip_ci_label: ${{ steps.get-pr-info.outcome == 'success' && contains(fromJSON(steps.get-pr-info.outputs.pr-info).labels.*.name, 'skip-ci') || false }}
101-
publish_docs: ${{ steps.policy.outputs.publish_docs }}
10295
publish_packages: ${{ steps.policy.outputs.publish_packages }}
10396
pr_info: ${{ steps.get-pr-info.outcome == 'success' && steps.get-pr-info.outputs.pr-info || '' }}
10497

@@ -158,10 +151,8 @@ jobs:
158151
}}
159152
permissions:
160153
contents: read
161-
with:
162-
ref_type: ${{ github.ref_type }}
163-
ref_name: ${{ github.ref_name }}
164-
publish_docs: ${{ needs.prepare.outputs.publish_docs == 'true' }}
154+
secrets:
155+
DOCS_FERN_TOKEN: ${{ secrets.DOCS_FERN_TOKEN }}
165156

166157
ci_rust:
167158
name: Rust
@@ -256,7 +247,6 @@ jobs:
256247
NODE_RESULT: ${{ needs.ci_node.result }}
257248
PYTHON_RESULT: ${{ needs.ci_python.result }}
258249
WEBASSEMBLY_RESULT: ${{ needs.ci_wasm.result }}
259-
publish_docs: ${{ needs.prepare.outputs.publish_docs }}
260250
publish_packages: ${{ needs.prepare.outputs.publish_packages }}
261251
run: |
262252
set -euo pipefail
@@ -283,11 +273,7 @@ jobs:
283273
require_success "Changes" "$CHANGES_RESULT"
284274
require_success "Check" "$CHECK_RESULT"
285275
286-
if [[ "$publish_docs" == "true" ]]; then
287-
require_success "Documentation" "$DOCS_RESULT"
288-
else
289-
allow_success_or_skipped "Documentation" "$DOCS_RESULT"
290-
fi
276+
allow_success_or_skipped "Documentation" "$DOCS_RESULT"
291277
292278
if [[ "$publish_packages" == "true" ]]; then
293279
require_success "Rust" "$RUST_RESULT"
@@ -307,22 +293,6 @@ jobs:
307293
exit 1
308294
fi
309295
310-
deploy-docs:
311-
name: Deploy Documentation
312-
needs: [prepare, ci_required]
313-
if: ${{ needs.prepare.outputs.publish_docs == 'true' && needs.ci_required.result == 'success' }}
314-
runs-on: ubuntu-latest
315-
permissions:
316-
pages: write
317-
id-token: write
318-
environment:
319-
name: github-pages
320-
url: ${{ steps.deployment.outputs.page_url }}
321-
steps:
322-
- name: Deploy GitHub Pages Site
323-
id: deployment
324-
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5
325-
326296
release-cli-artifacts:
327297
name: Release CLI Artifacts
328298
needs: [prepare, ci_required]

.github/workflows/ci_docs.yml

Lines changed: 9 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,15 @@ name: Documentation
55

66
on:
77
workflow_call:
8-
inputs:
9-
ref_type:
10-
description: 'The ref type from the triggering workflow'
11-
required: true
12-
type: string
13-
ref_name:
14-
description: 'The ref name from the triggering workflow'
15-
required: true
16-
type: string
17-
publish_docs:
18-
description: 'Whether to upload a GitHub Pages artifact for deployment'
8+
secrets:
9+
DOCS_FERN_TOKEN:
1910
required: false
20-
default: false
21-
type: boolean
2211
defaults:
2312
run:
2413
shell: bash
2514

2615
env:
27-
GH_TOKEN: "${{ github.token }}"
28-
GIT_COMMIT: "${{ github.sha }}"
2916
NEMO_RELAY_CI_WORKSPACE: "${{ github.workspace }}"
30-
NEMO_RELAY_CI_WORKSPACE_TMP: "${{ github.workspace }}/tmp"
3117
UV_PYTHON_DOWNLOADS: never
3218

3319
jobs:
@@ -41,8 +27,6 @@ jobs:
4127
steps:
4228
- name: Checkout
4329
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
44-
with:
45-
fetch-depth: 0
4630

4731
- name: Load CI tool versions
4832
id: ci-config
@@ -66,7 +50,7 @@ jobs:
6650

6751
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
6852
with:
69-
shared-key: nemo-relay-rust-${{ runner.os }}-${{ runner.arch }}-${{ steps.ci-config.outputs.rust_version }}
53+
shared-key: nemo-relay-rust-docs-${{ runner.os }}-${{ runner.arch }}-${{ steps.ci-config.outputs.rust_version }}
7054
workspaces: . -> target
7155
cache-all-crates: true
7256
cache-bin: false
@@ -79,43 +63,17 @@ jobs:
7963
8064
- uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
8165
with:
82-
tool: just@${{ steps.ci-config.outputs.just_version }},sphinx-rustdocgen@1.0.1
66+
tool: just@${{ steps.ci-config.outputs.just_version }}
8367

8468
- name: Install Documentation Dependencies
8569
working-directory: ${{ env.NEMO_RELAY_CI_WORKSPACE }}
86-
run: uv sync --no-default-groups --group docs --no-install-project
87-
88-
- name: Install Node.js Documentation Dependencies
89-
working-directory: ${{ env.NEMO_RELAY_CI_WORKSPACE }}
90-
run: npm ci --ignore-scripts
91-
92-
- name: Materialize Main Branch For Versioned Docs
93-
if: ${{ inputs.ref_type == 'tag' }}
94-
working-directory: ${{ env.NEMO_RELAY_CI_WORKSPACE }}
95-
run: git fetch --force origin +refs/heads/main:refs/heads/main
96-
97-
- name: Check Documentation Links
98-
working-directory: ${{ env.NEMO_RELAY_CI_WORKSPACE }}
99-
env:
100-
NEMO_RELAY_DOCS_DEPS_READY: "1"
101-
run: just docs-linkcheck
70+
run: |
71+
uv sync --no-default-groups --group dev --no-install-project
72+
npm ci --ignore-scripts
10273
103-
- name: Build Documentation Site
104-
if: ${{ startsWith(inputs.ref_name, 'pull-request/') || inputs.ref_name == 'main' }}
74+
- name: Check Documentation
10575
working-directory: ${{ env.NEMO_RELAY_CI_WORKSPACE }}
10676
env:
10777
NEMO_RELAY_DOCS_DEPS_READY: "1"
78+
FERN_TOKEN: ${{ secrets.DOCS_FERN_TOKEN }}
10879
run: just docs
109-
110-
- name: Build Versioned Documentation Site
111-
if: ${{ inputs.publish_docs }}
112-
working-directory: ${{ env.NEMO_RELAY_CI_WORKSPACE }}
113-
env:
114-
NEMO_RELAY_DOCS_DEPS_READY: "1"
115-
run: just docs-github-pages
116-
117-
- name: Upload GitHub Pages Artifact
118-
if: ${{ inputs.publish_docs }}
119-
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
120-
with:
121-
path: ${{ env.NEMO_RELAY_CI_WORKSPACE }}/docs/_build/pages

0 commit comments

Comments
 (0)