Skip to content

docs(fern): scaffold Fern docs site mirroring published v0.4.0 sidebar#2196

Open
lbliii wants to merge 12 commits intomainfrom
lbliii/ctf
Open

docs(fern): scaffold Fern docs site mirroring published v0.4.0 sidebar#2196
lbliii wants to merge 12 commits intomainfrom
lbliii/ctf

Conversation

@lbliii
Copy link
Copy Markdown

@lbliii lbliii commented May 8, 2026

Summary

image

conversion preview

Migrates the NeMo AutoModel docs from Sphinx (docs/) to a Fern MDX site (fern/), mirroring the published v0.4.0 sidebar at https://docs.nvidia.com/nemo/automodel/latest verbatim — engineers can side-by-side diff against the live site without spurious title shifts. The Sphinx tree under docs/ is left in place for now; removal is a follow-up PR after preview sign-off.

Content layout

fern/
├── docs.yml                  # site config (instances, versions, redirects, libraries, theme)
├── fern.config.json          # Fern CLI pin (≥ 4.62.4)
├── main.css                  # NVIDIA theme
├── assets/                   # NVIDIA SVGs
├── components/               # CustomFooter.tsx, BadgeLinks.tsx, Tag.tsx
├── versions/
│   ├── nightly.yml           # paths → ./nightly/pages/
│   ├── nightly/pages/        # bleeding-edge tree — edited every PR (130 pages)
│   ├── v0.4.yml              # paths → ./v0.4/pages/
│   ├── v0.4/pages/           # frozen 0.4.0 tree — back-ports only (130 pages)
│   └── latest.yml            # GA alias — paths → ./v0.4/pages/; repoints on next GA cut
├── product-docs/             # GENERATED Python API reference (gitignored)
└── README.md

nightly/pages/ and v0.4/pages/ are separate, independent content trees with their own copy of every file. They're byte-identical today (0.4.0 just shipped from this exact content) and will diverge as nightly accumulates post-release edits. latest.yml mounts the current GA's content (today: ./v0.4/pages/...).

Version dropdown matches the published Sphinx site:

display-name slug availability
nightly nightly beta
Latest latest stable
0.4.0 · 26.04 v0.4 stable

What's in this PR

  1. Sphinx → Fern conversion of all 130 MyST .md files, plus 12 image assets, into MDX. Sidebar structure, section captions, page titles, and Model Coverage child ordering are taken verbatim from the published v0.4.0 site (not from the local source toctree, which has post-release additions).
  2. Two physical content treesnightly/pages/ and v0.4/pages/ — so 0.4.0 can stay frozen while nightly moves forward. latest.yml is the GA alias.
  3. NVIDIA theme + custom-domain at docs.nvidia.com/nemo/automodel. experimental.basepath-aware: true set for subpath hosting.
  4. Redirects for old Sphinx URL forms — /index.html, /<page>.html, /<version>/<path>/index.html, the legacy 0.4v0.4 rewrite, and explicit per-version-root rules (/<version>/index.html) because Fern's :path* does not match the empty-path case (docs: fix broken links — redirects, GitHub source links, drift Curator#1938).
  5. Slug overrides on every page so URLs stay short (/get-started/installation) while sidebar titles match the verbose published H1s (Install NeMo AutoModel).
  6. API library reference via Fern's libraries: (replaces the Sphinx autodoc2 setup). Pyright-extracts Markdown from nemo_automodel/ on every preview/publish; fern/product-docs/ is gitignored.
  7. CI workflows with the FW-CI mirror-bot trigger pattern (push: pull-request/[0-9]+, matching existing build-docs.yml):
    • fern-docs-ci.ymlfern check on PRs
    • fern-docs-preview-build.yml + fern-docs-preview-comment.yml — split untrusted/trusted preview build that posts a 🌿 comment
    • publish-fern-docs.yml — publishes on push-to-main with fern/** changes, on docs/v* tag, or via manual dispatch
  8. Makefile at repo root with make docs / docs-check / docs-preview / docs-publish targets so contributors don't have to memorize cd fern && fern … invocations.
  9. fern/README.md — human-facing orientation (layout, local dev, sidebar fidelity rule, authoring conventions, versioning cookbook, troubleshooting).
  10. skills/fern-docs/SKILL.md — agent skill registered in AGENTS.md and skills/README.md (entry ddp parity #10) covering page operations, slug + redirect cookbook, redirect quirks (:path* empty-path gotcha), pnpm 10 esbuild gotcha, and the cut-a-new-train procedure.

Required infrastructure

  • DOCS_FERN_TOKEN org secret — already wired for the existing build-docs.yml; no new setup needed.
  • FW-CI mirror botfern-docs-ci.yml triggers on the same pull-request/[0-9]+ branches the bot already pushes to for build-docs.yml.

What's NOT in this PR

  • docs/ removal. Left in place so reviewers can diff Fern output against the Sphinx source. Remove in a follow-up after preview review.
  • A real frozen v0.4.0 snapshot. Today's v0.4/pages/ is the same content as nightly/pages/ (current main); a true v0.4.0 snapshot would need to be migrated from the v0.4.0 git tag's docs/. Out of scope here; back-fill in a follow-up.
  • Nightly publish automation. The Sphinx side has release-nightly-docs.yml; a Fern equivalent that publishes versions/nightly/pages/ on push-to-main is a follow-up. The current publish-fern-docs.yml only fires on docs/v* tags or manual dispatch.
  • Sphinx workflow retirement. release-docs.yml and release-nightly-docs.yml continue to publish the Sphinx site; retire or repoint at fern/ once Fern is the canonical source.

Validation

All 7 convert-to-fern validation checks pass:

Check Result
validate_fern_version_yml
fern_check
fern_docs_broken_links (advisory --skip-broken-links; strict mode false-positives on version-agnostic links)
check_mdx_safety
check_unconverted
validate_fern_internal_links (URLMap-based, authoritative) ✅ — 0 invalid internal links across 128 nav-routed pages
sanity_check_migration

Test plan

  • Run make docs locally, confirm sidebar groups match the published 0.4.0 site one-for-one
  • Spot-check ~10 page titles against docs.nvidia.com/nemo/automodel/latest (e.g. "Install NeMo AutoModel", "Supervised Fine-Tuning (SFT) and Parameter-Efficient Fine-Tuning (PEFT) with NeMo AutoModel", "Fine-Tuning Gemma 4 31B on CORD-v2 Receipts — End-to-End Guide")
  • Confirm version dropdown shows nightly (Beta), Latest (Stable), 0.4.0 · 26.04 (Stable)
  • Verify a few internal links resolve: /get-started/installation, /recipes-e2e-examples/sft-peft, /model-coverage/large-language-models/llama
  • Verify image rendering: gemma3-3n.mdx (medpix images), databricks.mdx (GPU metrics), pretraining.mdx (gpt2 loss), fp8-training.mdx, latest-models.mdx (Brev launchable badge)
  • After preview deploy, confirm redirects: docs.nvidia.com/nemo/automodel/v0.4/index.html/v0.4 (the empty-path case), /nemo/automodel/about/index.html/about, /0.4/<path>/v0.4/<path>
  • Confirm API Reference renders under Development → API Reference (mounts product-docs/nemo-automodel/Full-Library-Reference/)

Commits

0b3751ef Scaffold Fern docs (130 MDX, sidebar parity)
5a953d70 CI workflows + basepath-aware
a8444868 API library reference + Makefile docs targets
233138dd fern/README.md + skills/fern-docs/SKILL.md agent skill
420b59d2 Empty-path redirect fix (8 explicit version-root rules)
8d173557 Drop _nav_order / _nav_titles migration sidecars
4d65d764 Repoint nightly as the canonical YAML name
a181840c Split nightly and v0.4 into separate physical content trees

All commits are DCO-signed.

🤖 Generated with Claude Code

lbliii and others added 2 commits May 8, 2026 09:54
Migrates the Sphinx MyST docs in docs/ to a Fern MDX site under fern/.
Sidebar structure, section captions, page titles, and Model Coverage
child ordering are taken verbatim from
docs.nvidia.com/nemo/automodel/latest, not from the local source
toctree, so engineers can side-by-side diff against the published 0.4.0
site without spurious title changes.

- 130 source .md files converted to .mdx under fern/versions/v0.4/pages/
- versions/{latest,nightly}.yml added as aliases (v0.4 is the current GA
  train; nightly tracks main once it has its own content)
- explicit slug: overrides on every page so URLs stay short while sidebar
  titles match the verbose published H1s
- NVIDIA theme + custom-domain (docs.nvidia.com/nemo/automodel) wired up
- redirects generated to preserve old Sphinx /index.html and .html links
- docs/ tree left in place; remove in a follow-up PR after preview review

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Lawrence Lane <llane@nvidia.com>
… site

Adds the bundled Fern CI suite from the convert-to-fern toolkit and the
`experimental.basepath-aware: true` flag required for subpath-hosted
sites (docs.nvidia.com/nemo/automodel).

- fern-docs-ci.yml — `fern check` on PRs. Trigger uses the FW-CI mirror
  bot pattern (`push: branches: pull-request/[0-9]+`) — same as
  build-docs.yml — so DOCS_FERN_TOKEN is available even for fork PRs.
  This is the fix landed in NVIDIA-NeMo/Gym#1241.
- fern-docs-preview-build.yml + fern-docs-preview-comment.yml —
  two-workflow split: build collects PR sources without secrets (safe
  for forks), comment workflow is triggered via workflow_run with the
  trusted base context, builds the preview, and posts a herb-emoji PR
  comment.
- publish-fern-docs.yml — publishes to docs.nvidia.com/nemo/automodel
  on push to main with fern/** changes or via workflow_dispatch.

Required org secret: DOCS_FERN_TOKEN (already present for build-docs.yml).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Lawrence Lane <llane@nvidia.com>
Adds the API reference Sphinx had via autodoc2, plus contributor-facing
make targets so nobody has to memorize `cd fern && fern …` incantations.

- libraries: in fern/docs.yml — Fern clones the repo and generates
  Markdown from the nemo_automodel package source on every preview /
  publish. lang: python uses Pyright-based extraction.
- versions/v0.4/pages/api-reference/index.mdx — overview landing page
  describing the key modules (matches Gym's pattern in #1241).
- API Reference section added under "Development" in v0.4.yml (and
  re-synced into latest.yml + nightly.yml) — placement mirrors the
  published Sphinx site, where apidocs/index sat as the last entry of
  the Development caption.
- index.mdx Card href updated from the GitHub-source workaround to the
  in-site /development/api-reference/overview route.
- fern/product-docs/ added to .gitignore — generated tree, recreated
  by `fern docs md generate` on demand. Gym does not commit theirs
  either.
- Top-level Makefile: docs, docs-check, docs-preview, docs-publish
  targets. `make docs` runs `fern docs md generate` then `fern docs
  dev` so the local preview shows the API reference too (otherwise
  cold dev fails with "Folder not found: ./product-docs/...").

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Lawrence Lane <llane@nvidia.com>
Two artifacts to make the new Fern site discoverable and maintainable:

- fern/README.md — human-facing orientation: layout, local-dev quick
  reference, sidebar-fidelity rule, authoring conventions (frontmatter,
  components, version-agnostic links, cross-repo refs), versioning
  cookbook, CI overview, troubleshooting table.
- skills/fern-docs/SKILL.md — agent skill following the same
  name/description/when_to_use frontmatter convention as the existing
  AutoModel skills (cicd, recipe-development, etc.). Covers the four
  page operations (add/update/move/remove), the single-canonical-tree
  rule that distinguishes us from Gym's old two-version mirror, slug
  override + redirect cookbook, fern check / preview / publish
  workflow, version-train cut procedure, and a debugging table.
- AGENTS.md + skills/README.md — register the new skill in both
  indexes so it shows up alongside cicd, testing, model-onboarding, etc.

Both documents are tailored to AutoModel's actual setup — single
content tree at fern/versions/v0.4/pages/, three nav-YAML aliases
(latest, nightly, v0.4), Make-driven local commands, FW-CI mirror-bot
trigger pattern, sidebar-parity-with-published-v0.4.0 rule.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Lawrence Lane <llane@nvidia.com>
Previously v0.4.yml just pointed at ./nightly/pages/ — same files, two
slugs. That's wrong: 0.4.0 is a frozen release snapshot and needs its
own independent copy of every page so it can stay still while nightly
moves forward.

- cp -r fern/versions/nightly fern/versions/v0.4 — physical duplicate
  of all 130 pages and 12 image assets. Byte-for-byte identical today
  (we just shipped 0.4.0); will diverge as nightly accumulates
  post-release edits and v0.4 stays frozen except for explicit back-ports.
- Updated fern/versions/v0.4.yml paths from ./nightly/pages/ →
  ./v0.4/pages/.
- Updated fern/versions/latest.yml paths from ./nightly/pages/ →
  ./v0.4/pages/ (latest is the GA alias; today it serves v0.4 content;
  repointed at the next GA's tree when one is cut).
- README and skill rewritten to be explicit: nightly/ and v0.4/ are
  separate, independent trees; default editing target is nightly/;
  v0.4/ only changes via deliberate back-port.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Lawrence Lane <llane@nvidia.com>
Matches the existing capitalization of Latest in the same dropdown
and the Main label NeMo Gym uses for their bleeding-edge slug. The
URL slug stays lowercase (`/nightly/...`).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Lawrence Lane <llane@nvidia.com>
lbliii and others added 2 commits May 8, 2026 12:57
… 403 case

NVIDIA-NeMo/Gym#1185 surfaces the recurring confusion: contributors run
`fern docs md generate` and get `HTTP 403: User does not belong to
organization`, with no breadcrumb back to the fix. The fix is a
specific 3-step sequence — sign in to dashboard.buildwithfern.com (not
Google SSO; use email/magic-link so Fern provisions the account), then
`fern login` from the CLI. Skipping step 1 leaves the CLI auth flow
without a working path forward.

Adds:
- `make docs-login` — first-time auth helper that prints the 3-step
  flow and then runs `fern login`.
- `docs-generate-library` extracted as its own target and wrapped in a
  shell trap that prints the recovery pointer (`make docs-login`) when
  the autodoc step fails. `make docs` now depends on it.

Mirrors the same change landing in NVIDIA-NeMo/Gym#1255 for the Gym
Makefile.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Lawrence Lane <llane@nvidia.com>
The previous version slept 2 seconds then ran `fern login` — not
enough time for the user to actually open the browser, sign in to
dashboard.buildwithfern.com, and confirm the 'nvidia' org is visible.
If they didn't, the CLI launches in a state where it can't authenticate
(no email entry path forward, per #1185 slack thread).

Now the target prompts:

    Have you completed step 1 (dashboard sign-in)? [yes/N]:

and bails with a clear "go do step 1, then re-run" message on anything
other than yes. Mirrors the same change in NVIDIA-NeMo/Gym#1255.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Lawrence Lane <llane@nvidia.com>
- Adds a `## Quickstart` section that walks new contributors through
  the install-CLI → docs-login → make docs flow with one block of
  copy-pasteable commands.
- Adds a `### Fern CLI + docs reference` table linking to the
  upstream Fern documentation pages we actually point people at
  (CLI, components, frontmatter, versioning, redirects, libraries),
  plus the dashboard URL and #fern Slack channel. The skill had only
  the in-repo links; this surfaces the upstream ones the way the
  user asked.
- Drops the "Latest preview" row from the Quick links table (the
  hosted preview URL `nemo-automodel.docs.buildwithfern.com/...`
  shouldn't be linked publicly from this README).
- Replaces the old "First-time setup" subsection in the Local
  development block with a pointer to the new Quickstart, since
  `make docs-login` already does the work.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Lawrence Lane <llane@nvidia.com>
@jgerh
Copy link
Copy Markdown
Contributor

jgerh commented May 8, 2026

PR Review — Sphinx → Fern Migration Scaffolding Checks Completed

  • Documentation file mapping — All 130 source .md files map cleanly to 131 .mdx files in both v0.4/pages/ and nightly/pages/ (the additional file is an expected index.mdx stub). No missing or orphaned pages.
  • Non‑docs directories — All non‑docs directories match one‑to‑one across branches, with the only intentional delta being skills/fern-docs/SKILL.md. Divergence in examples/ is expected due to ongoing feature work.
  • Navigation reachability — Every path: entry in both nav files resolves to a real file.
  • Slug wiring — Representative spot checks confirm slugs are correctly assigned and consistent with v0.4.yml.
  • Redirect rules — All redirect patterns described in the PR are present and correctly wired in docs.yml.
  • Validation checks — All seven convert‑to‑fern validations pass, including zero invalid internal links across 128 nav‑routed pages.
  • Local preview — Verified sidebar grouping, version dropdown behavior, internal routing, image rendering, and page titles in preview.

Verdict
Everything required for the migration scaffolding is in place. No blockers. v0.4 and nightly are fully aligned, navigation is intact, and validation is clean. Redirects and API Reference rendering appear correct but will be fully confirmed on live deploy. Safe to merge once reviewers sign off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants