Skip to content

docs: migrate from MkDocs to Fern#175

Draft
yamini wants to merge 2 commits into
mainfrom
docs-mkdocs-to-fern/ykagal
Draft

docs: migrate from MkDocs to Fern#175
yamini wants to merge 2 commits into
mainfrom
docs-mkdocs-to-fern/ykagal

Conversation

@yamini
Copy link
Copy Markdown
Contributor

@yamini yamini commented Jun 4, 2026

Summary

Migrates the NeMo Platform documentation from MkDocs (Material) to Fern MDX, the new required docs format. Converts all 188 published pages, scaffolds the Fern site under docs/fern/, wires the REST API reference natively from the OpenAPI spec, and preserves the current launch gating.

Draft for review — not for merge yet. Local preview + fern check + fern docs broken-links all pass. A few follow-ups are listed below (notably the Fern org theme access and docs CI migration).

What changed

  • 188 pages converted from MkDocs Material/pymdown to Fern MDX: admonitions → <Note>/<Warning>/..., === "tab"<Tabs>/<Tab>, --8<-- snippets inlined, {{ macro }} variables substituted, and MDX-unsafe braces/HTML comments escaped.
  • Nested layout (the preferred NeMo pattern, per Automodel #2291): authored MDX lives at docs/<section>/<page>.mdx; Fern config/theme/components/nav live under docs/fern/.
  • Native API reference: the OpenAPI spec is registered at docs/fern/apis/nemo-platform/ and rendered as an interactive, per-endpoint API reference (replaces the old <swagger-ui> embed, which doesn't work in Fern).
  • Launch gating preserved: the sections the MkDocs hide_unready_docs hook hides (Platform, Fine-tune Models/Customizer, Synthesize Safe Data/Safe Synthesizer, Example Applications, plus gated paths like auth/**, evaluator/benchmarks/**) are marked hidden: true — out of the sidebar but still routable, so cross-links resolve and there are no 404s. Same visible surface as the current site.
  • Stable URLs: explicit slug: on every nav entry pins clean slugs (the Fern CLI otherwise splits CamelCase/acronyms, e.g. NemoGuard NIMsnemo-guard-ni-ms).
  • Redirects carried over from the old MkDocs redirects plugin.
  • llms.txt: served automatically by Fern (/llms.txt, /llms-full.txt) — no extra files needed.
  • Removed the MkDocs apparatus: mkdocs.yml, docs/_hooks, docs/_overrides, theme assets, and the excluded template/, work/, notebooks/ trees.

Reviewing the diff

Commits are split so each page is reviewable:

  1. renamegit mv docs/*.md → docs/*.mdx (no content change; pure renames).
  2. convert — the actual MDX conversion + docs/fern/ scaffold.

So git show <convert> -- docs/<page>.mdx shows the conversion, and git log --follow docs/<page>.mdx reaches the original .md history.

Preview locally (hot-reload, like mkdocs serve)

npm install -g fern-api        # once
cd docs/fern
fern docs dev                  # http://localhost:3000, hot-reload

fern check and fern docs broken-links validate config and links (these are what CI should run).

Verification

  • fern check0 errors
  • fern docs broken-linksall checks passed (0 broken)
  • Visual spot-checks: homepage, a Tabs page (manage-files — tab widget renders), an images page (multimodal-data — image renders), and the generated API reference (per-endpoint pages) all render.
  • No unconverted MkDocs syntax remains (check_unconverted clean across docs/ — no leftover !!! admonitions, === "tab" blocks, ??? details, or MyST roles). The only 2 flags are literal {{ auth_secret }} Jinja examples inside inline code in cli/reference.mdx, which render correctly as intended.

Follow-ups before merge

  • Fern org theme accessdocs/fern/docs.yml currently uses a minimal NVIDIA-green theme so the site builds/previews for anyone. To get the full NVIDIA chrome, the publishing Fern account/org must be granted access to the NVIDIA/fern-components global theme (otherwise fern docs dev/generate returns HTTP 403). Then replace the colors block with global-theme: nvidia (documented inline).
  • Docs CI migrationdocs.yaml (and the docs job in ci.yaml) still build MkDocs and will fail. Replace with the Fern CI workflows (fern-docs-ci.yml etc.), which need a DOCS_FERN_TOKEN secret for preview/publish.
  • Asset de-dup — original MkDocs image/asset dirs under docs/ remain alongside the docs/fern/ copies Fern serves. Safe to remove (all image refs are absolute → docs/fern/); left in place pending a visual confirmation pass.
  • Notebooks — the .ipynb tutorials (Customizer, Example Applications) are all in currently-gated sections and were not converted; wire NotebookViewer when those sections un-gate.

🤖 Generated with Claude Code

yamini added 2 commits June 4, 2026 01:32
Pure renames so git --follow tracks each page's history through the
mkdocs->fern conversion (the conversion lands in the next commit).
- Convert 188 pages from mkdocs Material/pymdown to Fern MDX (admonitions,
  tabs, snippets inlined, macro variables substituted, MDX-safe escaping).
- Scaffold docs/fern: docs.yml, fern.config.json (CLI 5.44.7), versions/latest.yml
  with explicit slugs, NVIDIA-green theme (global-theme: nvidia documented toggle,
  pending org theme access), redirects carried over from the mkdocs redirects plugin.
- Native Fern API reference from the OpenAPI spec (docs/fern/apis/nemo-platform).
- Preserve launch gating: sections hidden via the same rules as the mkdocs
  hide_unready_docs hook (hidden in nav, still routable so links resolve).
- Hoist converted MDX to docs/ top-level; remove mkdocs.yml, hooks, overrides,
  theme assets, and excluded template/work/notebooks trees.

fern check + fern docs broken-links both pass.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

Suite Lines Covered Line Rate Branch Rate
Unit Tests N/A N/A N/A
Integration Tests N/A N/A N/A

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.

1 participant