Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fern/versions/latest/pages/contribute/agent-skills.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ The [`nemo-gym-docs`](https://github.com/NVIDIA-NeMo/Gym/tree/main/.agents/skill
## Related Topics

- [Development Setup](/contribute/development-setup) — environment setup, CI, and commit requirements
- [Add a Benchmark](https://docs.nvidia.com/nemo/gym/contribute/environments/adding-a-benchmark) — human-readable tutorial that complements the `add-benchmark` skill
- [Add a Benchmark](/contribute/environments/adding-a-benchmark) — human-readable tutorial that complements the `add-benchmark` skill
- [Contribute Environments](/contribute/environments) — guidance for new training environments
19 changes: 19 additions & 0 deletions tests/unit_tests/test_fern_docs_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,25 @@ def test_reward_profile_cards_use_the_generated_heading_anchor(self):
self.assertEqual([], broken_links)
self.assertEqual(2, canonical_links)

def test_internal_pages_are_linked_by_path_not_by_absolute_url(self):
"""An absolute docs.nvidia.com link pins the reader to the default version.

Relative paths keep the reader inside the version they are already reading.
Prose that names the domain without linking to it is fine.

Scoped to `latest`. The frozen versions carry the same pattern but are left as
they shipped.
"""
pages = REPO_ROOT / "fern/versions/latest/pages"
absolute_links = []

for page in pages.rglob("*.mdx"):
for line_number, line in enumerate(page.read_text().splitlines(), start=1):
if re.search(r'(?:\]\(|href=")https?://docs\.nvidia\.com/nemo/gym', line):
absolute_links.append(f"{page.relative_to(REPO_ROOT)}:{line_number}")

self.assertEqual([], absolute_links)

def test_private_cli_compat_api_link_redirects_to_the_public_cli_page(self):
redirects = read("fern/docs.yml")
expected_redirect = """ - source: "/nemo/gym/nemo-gym/nemo_gym/cli/_compat"
Expand Down
Loading