nemo-gym-docs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNeMo Gym Docs Maintenance
NeMo Gym文档维护
Unified skill for adding, updating, moving, and removing pages on the NeMo Gym Fern documentation site.
用于在NeMo Gym Fern文档站点上添加、更新、移动和删除页面的统一操作指南。
Scope Rule
范围规则
ALL docs edits happen under . All new pages — including release notes and migration guides — belong under .
fern/fern/Bleeding-edge tree + GA snapshots. Gym keeps one bleeding-edge content tree at (the folder name is historical — it's mounted under the slug via ) and one frozen GA snapshot per shipped release (currently ). All new edits land in . The file is a GA alias — a symlink to the current GA's yml — so and serve the same pages. Back-ports into a frozen GA snapshot are deliberate and rare; default to editing only.
fern/versions/latest/mainmain.ymlfern/versions/v0.2.1/fern/versions/latest/latest.yml/latest/.../<current-ga>/...fern/versions/latest/所有文档编辑操作均在目录下进行。 所有新页面——包括发布说明和迁移指南——都应放在目录下。
fern/fern/前沿版本树 + GA快照。Gym在维护一个前沿内容树(文件夹名称是历史遗留的——通过挂载在路径下),每个已发布版本对应一个冻结的GA快照(当前为)。所有新编辑内容都提交到。文件是GA别名——指向当前GA版本yml文件的符号链接——因此和会展示相同的页面。向冻结的GA快照进行回溯移植是刻意且罕见的操作;默认仅编辑目录下的内容。
fern/versions/latest/main.ymlmainfern/versions/v0.2.1/fern/versions/latest/latest.yml/latest/.../<current-ga>/...fern/versions/latest/Layout at a Glance
概览布局
fern/
├── fern.config.json # Org + Fern CLI version (currently 4.80.3)
├── package.json # `npm run dev|check|generate` — wraps `npx -y fern-api@latest`
├── docs.yml # Site config: instances, versions, tabs, redirects, libraries
├── versions/
│ ├── latest.yml # GA alias — symlink to the current GA's yml (currently v0.2.1.yml)
│ ├── main.yml # Nav tree for the bleeding-edge train (mounts ./latest/pages)
│ ├── latest/pages/ # MDX content for the bleeding-edge train (slug: main)
│ ├── v0.2.1.yml # Nav tree for the 0.2.1 GA snapshot
│ └── v0.2.1/pages/ # MDX content for the 0.2.1 GA snapshot
├── components/ # Custom TSX (CTAButtons, NavButton, CustomFooter)
├── assets/ # Images, SVGs, favicon
├── main.css # Global theme overrides (NVIDIA green, badge spacing, etc.)
└── product-docs/ # GENERATED library reference (gitignored)File system Published URL
───────────────────────────────────────────────────── ──────────────────────────────────
fern/versions/latest/pages/get-started/quickstart.mdx docs.nvidia.com/nemo/gym/main/get-started/quickstart
fern/versions/v0.2.1/pages/get-started/quickstart.mdx docs.nvidia.com/nemo/gym/v0.2.1/get-started/quickstart
docs.nvidia.com/nemo/gym/latest/get-started/quickstart (GA alias)fern/
├── fern.config.json # Org + Fern CLI version (currently 4.80.3)
├── package.json # `npm run dev|check|generate` — wraps `npx -y fern-api@latest`
├── docs.yml # Site config: instances, versions, tabs, redirects, libraries
├── versions/
│ ├── latest.yml # GA alias — symlink to the current GA's yml (currently v0.2.1.yml)
│ ├── main.yml # Nav tree for the bleeding-edge train (mounts ./latest/pages)
│ ├── latest/pages/ # MDX content for the bleeding-edge train (slug: main)
│ ├── v0.2.1.yml # Nav tree for the 0.2.1 GA snapshot
│ └── v0.2.1/pages/ # MDX content for the 0.2.1 GA snapshot
├── components/ # Custom TSX (CTAButtons, NavButton, CustomFooter)
├── assets/ # Images, SVGs, favicon
├── main.css # Global theme overrides (NVIDIA green, badge spacing, etc.)
└── product-docs/ # GENERATED library reference (gitignored)File system Published URL
───────────────────────────────────────────────────── ──────────────────────────────────
fern/versions/latest/pages/get-started/quickstart.mdx docs.nvidia.com/nemo/gym/main/get-started/quickstart
fern/versions/v0.2.1/pages/get-started/quickstart.mdx docs.nvidia.com/nemo/gym/v0.2.1/get-started/quickstart
docs.nvidia.com/nemo/gym/latest/get-started/quickstart (GA alias)Operations
操作流程
Add a Page
添加页面
-
Gather: page title, target section, filename (kebab-case), subdirectory under
.mdx.fern/versions/latest/pages/ -
Create:
fern/versions/latest/pages/<subdirectory>/<filename>.mdxmdx--- title: "<Page Title>" description: "One-line SEO description (or empty string)" position: 3 --- # <Page Title> <content> -
If the parent folder is mounted inwith
main.yml, the page is auto-discovered — no nav edit needed. Otherwise add atitle-source: frontmatterentry under the right- page:insection:.fern/versions/main.yml -
Do not mirror into the current GA snapshot folder (e.g.,) — frozen GA snapshots only get back-ports on explicit request.
v0.2.1/
-
准备信息:页面标题、目标章节、文件名(短横线分隔的格式)、
.mdx下的子目录。fern/versions/latest/pages/ -
创建文件:
fern/versions/latest/pages/<subdirectory>/<filename>.mdxmdx--- title: "<Page Title>" description: "One-line SEO description (or empty string)" position: 3 --- # <Page Title> <content> -
如果父文件夹在中配置了
main.yml,页面会被自动识别——无需修改导航。否则需在title-source: frontmatter中对应fern/versions/main.yml下添加section:条目。- page: -
不要将内容镜像到当前GA快照目录(如)——冻结的GA快照仅在明确请求时才进行回溯移植。
v0.2.1/
Update a Page
更新页面
- Locate by path, title, or keyword (in
grep -rn).fern/versions/latest/pages/ - Content only — edit the MDX in . Don't touch
fern/versions/latest/pages/unless this is an explicit back-port.v0.2.1/ - Title change — update the frontmatter and (if the parent uses
title:) nothing else; otherwise update the navtitle-source: frontmatterentry too.- page: - Section move — the file, update its
git mvinpath:, fix all incoming links insidemain.yml.fern/versions/latest/pages/ - Slug change — folders use the page filename for the slug. Renaming the file changes the URL; add a redirect in so the old URL keeps working.
fern/docs.yml
- 通过路径、标题或关键词定位文件(在目录下使用
fern/versions/latest/pages/命令)。grep -rn - 仅修改内容——编辑下的MDX文件。除非是明确的回溯移植请求,否则不要触碰
fern/versions/latest/pages/目录。v0.2.1/ - 修改标题——更新前端元数据;如果父文件夹使用
title:,无需其他操作;否则还需更新导航中的title-source: frontmatter条目。- page: - 移动章节——使用命令移动文件,更新
git mv中的main.yml,修复path:目录内所有指向该文件的链接。fern/versions/latest/pages/ - 修改路径别名——文件夹使用页面文件名作为路径别名。重命名文件会改变URL;需在中添加重定向规则,确保旧URL仍可访问。
fern/docs.yml
Remove a Page
删除页面
- Find incoming links: .
grep -rn "<filename>" fern/versions/latest/pages --include="*.mdx" - the file from
git rm.fern/versions/latest/pages/ - Remove the matching block from
- page:if it was a manual entry.main.yml - Fix or remove all incoming links.
- Add a redirect in if the URL was public.
fern/docs.yml
- 查找指向该页面的链接:。
grep -rn "<filename>" fern/versions/latest/pages --include="*.mdx" - 使用命令删除
git rm下的文件。fern/versions/latest/pages/ - 如果该页面在中有手动添加的
main.yml块,将其移除。- page: - 修复或移除所有指向该页面的链接。
- 如果该URL已公开,需在中添加重定向规则。
fern/docs.yml
Back-port to a GA Snapshot
回溯移植到GA快照
Only back-port when the user explicitly asks ("back-port to v0.2.1"). Apply the same change inside the GA snapshot's folder (e.g., ) and update its yml if needed. is a symlink to the current GA's yml, so nav changes propagate automatically.
pages/fern/versions/v0.2.1/pages/latest.yml仅当用户明确要求时(如“回溯移植到v0.2.1”)才执行此操作。在GA快照的目录(如)中应用相同的修改,并根据需要更新其yml文件。是指向当前GA版本yml文件的符号链接,因此导航变更会自动同步。
pages/fern/versions/v0.2.1/pages/latest.ymlWorked Example: Adding a Page
实操示例:添加页面
Request: "Add a how-to for collecting rollouts under Get Started."
-
Create:
fern/versions/latest/pages/get-started/rollout-collection.mdxmdx--- title: "Collect Rollouts" description: "Run the agent against your dataset and write results to JSONL" position: 4 --- # Collect Rollouts <content> -
Thefolder in
get-startedusesmain.yml, so the page appears automatically.title-source: frontmattercontrols ordering — it's optional; without it, pages sort alphabetically by filename.position: 4 -
, verify
cd fern && npm run check && npm run devrenders./main/get-started/rollout-collection
请求:“在入门章节下添加收集rollouts的操作指南。”
-
创建文件:
fern/versions/latest/pages/get-started/rollout-collection.mdxmdx--- title: "Collect Rollouts" description: "Run the agent against your dataset and write results to JSONL" position: 4 --- # Collect Rollouts <content> -
中的
main.yml文件夹配置了get-started,因此页面会自动显示。title-source: frontmatter控制页面排序——该配置为可选;若未设置,页面会按文件名字母顺序排序。position: 4 -
执行,验证
cd fern && npm run check && npm run dev页面是否正常渲染。/main/get-started/rollout-collection
Worked Example: Renaming a Slug (with Redirect)
实操示例:重命名路径别名(带重定向)
Request: "Rename to ."
/main/get-started/setup/main/get-started/detailed-setup-
.
git mv fern/versions/latest/pages/get-started/setup.mdx fern/versions/latest/pages/get-started/detailed-setup.mdx -
Add a redirect in:
fern/docs.ymlyamlredirects: - source: "/main/get-started/setup" destination: "/main/get-started/detailed-setup" -
and update any incoming links.
grep -rn "/get-started/setup" fern/versions/latest/
请求:“将重命名为。”
/main/get-started/setup/main/get-started/detailed-setup-
执行。
git mv fern/versions/latest/pages/get-started/setup.mdx fern/versions/latest/pages/get-started/detailed-setup.mdx -
在中添加重定向规则:
fern/docs.ymlyamlredirects: - source: "/main/get-started/setup" destination: "/main/get-started/detailed-setup" -
执行并更新所有指向该路径的链接。
grep -rn "/get-started/setup" fern/versions/latest/
Content Guidelines
内容规范
NeMo Gym uses Fern-native MDX components directly. Do not use GitHub syntax — it will not render.
> [!NOTE]| Purpose | Component |
|---|---|
| Neutral aside | |
| Helpful tip | |
| Informational callout | |
| Warning | |
| Error / danger | |
| Card grid on index pages | |
| Status/scope tag inside a Card | |
Images live in (shared) or under a version's (version-scoped). Reference with root-relative paths.
fern/assets/pages/NeMo Gym直接使用Fern原生MDX组件。请勿使用GitHub的语法——该语法无法正常渲染。
> [!NOTE]| 用途 | 组件 |
|---|---|
| 中立提示 | |
| 实用技巧 | |
| 信息提示框 | |
| 警告 | |
| 错误/危险提示 | |
| 首页卡片网格 | |
| 卡片内的状态/范围标签 | |
图片存储在(共享目录)或对应版本的目录下(版本专属)。使用根相对路径引用图片。
fern/assets/pages/Cards and Badges
卡片与标签
Index pages use a grid. Each can carry one or more tags to indicate scope, status, or read-time.
<Cards><Card><Badge>Valid intents: , , , , , , , . Use (no intent) for neutral tags.
successnotetipwarningerrorinfolaunchcheck<Badge minimal outlined>...</Badge>Place badges as the last line inside the , separated by a blank line from the body text. The CSS in () handles spacing — do not add inline props.
<Card>main.css.fern-card .fern-docs-badgestyle=mdx
<Cards>
<Card title="Quickstart" href="/main/get-started/quickstart">
Install, start servers, and collect your first rollouts in one page.
<Badge intent="success" minimal outlined>start here</Badge> <Badge minimal outlined>5 min</Badge>
</Card>
</Cards>首页使用网格布局。每个可携带一个或多个标签,用于标识范围、状态或阅读时长。
<Cards><Card><Badge>有效的意图值包括:、、、、、、、。对于中立标签,使用(无需指定意图值)。
successnotetipwarningerrorinfolaunchcheck<Badge minimal outlined>...</Badge>将标签放在内的最后一行,与正文之间空一行。中的规则会处理间距——请勿添加内联属性。
<Card>main.css.fern-card .fern-docs-badgestyle=mdx
<Cards>
<Card title="Quickstart" href="/main/get-started/quickstart">
Install, start servers, and collect your first rollouts in one page.
<Badge intent="success" minimal outlined>start here</Badge> <Badge minimal outlined>5 min</Badge>
</Card>
</Cards>Frontmatter Fields
前端元数据字段
yaml
---
title: "<Page Title>" # required — used for nav and <h1>
description: "" # required (may be empty string) — SEO
position: 1 # optional — orders auto-discovered pages within a folder
---The MDX body should still open with matching the frontmatter title. Folders using in the version YAML pull the nav label from .
# <Page Title>title-source: frontmattertitle:yaml
---
title: "<Page Title>" # 必填——用于导航和<h1>标题
description: "" # 必填(可为空字符串)——用于SEO
position: 1 # 可选——控制自动识别页面在文件夹内的排序
---MDX正文仍需以开头,与前端元数据中的保持一致。在版本YAML中配置了的文件夹,会从中提取导航标签。
# <Page Title>title:title-source: frontmattertitle:Validate
验证
First-time setup: authenticate the CLI against the Fern org via Google SSO (one-time, browser flow):
nvidiabash
npx -y fern-api@latest login # opens browser → sign in with your @nvidia.com Google accountRun from (no install step — scripts shell out to ):
fern/npx -y fern-api@latestbash
npm run check # `fern check` — YAML + frontmatter validation
npm run dev # `fern docs dev` — localhost:3000 hot-reload previewfern check/latest/aboutdocs.ymllatest.ymlTo regenerate the autodoc library reference (gitignored under ):
product-docs/bash
npm run generate:library # `fern docs md generate`首次设置:通过Google SSO将CLI认证到 Fern组织(仅需一次,通过浏览器流程):
nvidiabash
npx -y fern-api@latest login # 打开浏览器 → 使用你的@nvidia.com谷歌账号登录在目录下执行以下命令(无需安装——脚本会调用):
fern/npx -y fern-api@latestbash
npm run check # `fern check` —— YAML和前端元数据验证
npm run dev # `fern docs dev` —— localhost:3000热重载预览提交前必须确保通过。开发服务器针对跨版本链接(如)的失效链接警告属于误报——Fern本地验证器无法从中解析版本路径别名与的对应关系。发布后的站点会正常渲染这些链接。
fern check/latest/aboutdocs.ymllatest.yml如需重新生成自动文档库引用(在目录下,已被git忽略):
product-docs/bash
npm run generate:library # `fern docs md generate`Commit & Preview
提交与预览
bash
git add fern/
git commit -s -m "docs: <add|update|remove> <page-title>"PRs that touch get an automatic Fern preview URL posted as a comment by . No manual step needed.
fern/**.github/workflows/fern-docs-preview-comment.yml ┌─ fern-docs-ci.yml → fern check
PR (touches fern/) ─┼─ fern-docs-preview-build.yml → upload fern/ artifact (no secrets)
└─ fern-docs-preview-comment.yml → 🌿 preview URL comment
Push to main (touches docs/** or fern/**) → publish-fern-docs.yml → docs.nvidia.com/nemo/gym
Tag push (docs/v*) → publish-fern-docs.yml → docs.nvidia.com/nemo/gym
Manual dispatch → publish-fern-docs.yml → docs.nvidia.com/nemo/gymThe preview-comment + publish jobs require the repository or organization secret (from ).
DOCS_FERN_TOKENfern tokenbash
git add fern/
git commit -s -m "docs: <add|update|remove> <page-title>"涉及的PR会由自动发布Fern预览URL作为评论。无需手动操作。
fern/**.github/workflows/fern-docs-preview-comment.yml ┌─ fern-docs-ci.yml → fern check
PR (touches fern/) ─┼─ fern-docs-preview-build.yml → 上传fern/构件(无需密钥)
└─ fern-docs-preview-comment.yml → 🌿 预览URL评论
Push to main (touches docs/** or fern/**) → publish-fern-docs.yml → docs.nvidia.com/nemo/gym
Tag push (docs/v*) → publish-fern-docs.yml → docs.nvidia.com/nemo/gym
Manual dispatch → publish-fern-docs.yml → docs.nvidia.com/nemo/gym预览评论和发布任务需要仓库或组织密钥(来自命令)。
DOCS_FERN_TOKENfern tokenPublishing to Production
发布到生产环境
Production publishes on three triggers (see ):
.github/workflows/publish-fern-docs.yml- Push to when
mainordocs/**changes — continuous staging.fern/** - Tag push matching — versioned release.
docs/v* - Manual dispatch from the Actions tab.
Tag format must be . Do not push a tag unless the user asks.
docs/v<MAJOR>.<MINOR>.<PATCH>bash
git tag docs/v0.3.0
git push origin docs/v0.3.0URL → version mapping:
docs.nvidia.com/nemo/gym/latest/... → GA alias (currently mirrors v0.2.1)
docs.nvidia.com/nemo/gym/main/... → bleeding-edge train (folder: ./latest/pages)
docs.nvidia.com/nemo/gym/v0.2.1/... → 0.2.1 GA snapshot生产环境发布有三个触发条件(详见):
.github/workflows/publish-fern-docs.yml- 推送到分支且
main或docs/**发生变更——持续部署到预发布环境。fern/** - 推送标签匹配——版本化发布。
docs/v* - 手动触发——从Actions标签页发起。
标签格式必须为。除非用户要求,否则请勿推送标签。
docs/v<MAJOR>.<MINOR>.<PATCH>bash
git tag docs/v0.3.0
git push origin docs/v0.3.0URL与版本的对应关系:
docs.nvidia.com/nemo/gym/latest/... → GA别名(当前镜像v0.2.1)
docs.nvidia.com/nemo/gym/main/... → 前沿版本(对应目录:./latest/pages)
docs.nvidia.com/nemo/gym/v0.2.1/... → 0.2.1 GA快照Cutting a New Version Train
创建新版本分支
When the user ships a new version (e.g. ):
v0.3.0- — frozen snapshot of the bleeding-edge folder.
cp -r fern/versions/latest fern/versions/v0.3.0 - and rewrite
cp fern/versions/main.yml fern/versions/v0.3.0.ymlpath prefixes to./latest/../v0.3.0/ - Retarget the symlink at the new GA's yml:
fern/versions/latest.yml.cd fern/versions && ln -sfn v0.3.0.yml latest.yml - In
fern/docs.yml, add the new GA snapshot entry (versions:,display-name: "0.3.0",slug: v0.3.0) and demote/remove the previous GA snapshot per the support policy.availability: stable - keeps moving forward as the bleeding-edge tree.
fern/versions/latest/pages/is unchanged.main.yml - Tag and push to publish.
docs/v0.3.0
当用户发布新版本(如)时:
v0.3.0- 执行——生成前沿目录的冻结快照。
cp -r fern/versions/latest fern/versions/v0.3.0 - 执行并将所有
cp fern/versions/main.yml fern/versions/v0.3.0.yml路径前缀替换为./latest/。./v0.3.0/ - 将符号链接重新指向新GA版本的yml文件:
fern/versions/latest.yml。cd fern/versions && ln -sfn v0.3.0.yml latest.yml - 在的
fern/docs.yml部分,添加新GA快照条目(versions:、display-name: "0.3.0"、slug: v0.3.0),并根据支持策略降级或移除旧GA快照条目。availability: stable - 继续作为前沿版本目录更新。
fern/versions/latest/pages/保持不变。main.yml - 打标签并推送以完成发布。
docs/v0.3.0
Debugging
调试
| Symptom | Fix |
|---|---|
| 2-space indent; |
| Page 404 in preview | |
Broken-link warning for | False positive in |
| Wrap multi-element MDX content in |
| Old URL breaks (page renamed/moved) | Add a |
| Library reference missing | |
| Broken image | Path is relative to the MDX file; check |
| Card badges have no spacing | Don't add inline styles — |
| They shouldn't — |
| 症状 | 修复方案 |
|---|---|
| 使用2空格缩进; |
| 预览中页面404 | 同一章节中 |
跨版本链接 | |
| 提示“JSX expressions must have one parent element” | 将多元素MDX内容包裹在 |
| 旧URL无法访问(页面已重命名/移动) | 在 |
| 库引用缺失 | 在 |
| 图片无法显示 | 路径是相对于MDX文件的路径;检查 |
| 卡片标签无间距 | 请勿添加内联样式—— |
| 不应出现此情况—— |
Key References
关键参考文件
| File | Purpose |
|---|---|
| Site config, versions, redirects, libraries |
| GA alias — symlink to the current GA's yml |
| Nav tree for the bleeding-edge train (mounts |
| Nav tree for the 0.2.1 GA snapshot |
| MDX content for a version |
| Custom TSX (CTAButtons, NavButton, CustomFooter) |
| Shared images, SVGs, favicon |
| Global theme overrides — NVIDIA green, card/badge spacing |
| `npm run check |
| CI: check, preview build, preview comment |
| CI: publish to docs.nvidia.com/nemo/gym |
| 文件 | 用途 |
|---|---|
| 站点配置、版本、重定向、库设置 |
| GA别名——指向当前GA版本yml文件的符号链接 |
| 前沿版本的导航树(挂载 |
| 0.2.1 GA快照的导航树 |
| 对应版本的MDX内容 |
| 自定义TSX组件(CTAButtons、NavButton、CustomFooter) |
| 共享图片、SVG、网站图标 |
| 全局主题覆盖——NVIDIA绿色、卡片/标签间距等 |
| `npm run check |
| CI流程:检查、预览构建、预览评论 |
| CI流程:发布到docs.nvidia.com/nemo/gym |