Skip to content

Commit 1760449

Browse files
authored
docs: Replace symlinks at build time to use markdown link syntax (#113)
Signed-off-by: Charlie Truong <chtruong@nvidia.com>
1 parent 6fad2df commit 1760449

3 files changed

Lines changed: 45 additions & 6 deletions

File tree

docs/conf.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,45 @@
2121
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
2222

2323
import os
24+
import shutil
25+
from pathlib import Path
26+
27+
28+
# -- Preprocessing: Replace symlinks with actual copies ---------------------
29+
def replace_symlinks_with_copies():
30+
"""Replace symlinked directories with actual copies at build time (CI only)."""
31+
# Only run in CI environments to avoid disrupting local development
32+
# GitHub Actions (and most CI systems) set CI=true
33+
if not os.environ.get("CI"):
34+
print("Skipping symlink replacement (not in CI environment)")
35+
return
36+
37+
docs_dir = Path(__file__).parent
38+
symlinks = ["usage-cookbook", "use-case-examples"]
39+
40+
for symlink_name in symlinks:
41+
symlink_path = docs_dir / symlink_name
42+
43+
# Check if it's a symlink
44+
if symlink_path.is_symlink():
45+
# Resolve the target
46+
target = symlink_path.resolve()
47+
48+
if target.exists():
49+
print(f"Replacing symlink {symlink_name} with actual copy from {target}")
50+
# Remove the symlink
51+
symlink_path.unlink()
52+
# Copy the actual directory
53+
shutil.copytree(target, symlink_path)
54+
else:
55+
print(f"Warning: Symlink target {target} does not exist")
56+
57+
58+
# Run preprocessing
59+
print("Running docs preprocessing...")
60+
replace_symlinks_with_copies()
61+
print("Preprocessing complete!")
62+
2463

2564
project = "Nemotron"
2665
copyright = "2026, NVIDIA Corporation"

usage-cookbook/Nemotron-3-Super/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ These notebooks provide end-to-end recipes for deploying and customizing Nemotro
1313
- **[vllm_cookbook.ipynb](vllm_cookbook.ipynb)** — Deploy Nemotron-3-Super with vLLM.
1414
- **[sglang_cookbook.ipynb](sglang_cookbook.ipynb)** — Deploy Nemotron-3-Super with SGLang.
1515
- **[trtllm_cookbook.ipynb](trtllm_cookbook.ipynb)** — Deploy Nemotron-3-Super with TensorRT-LLM.
16-
- **{doc}`AdvancedDeploymentGuide <AdvancedDeploymentGuide/README>`** — Production deployment configurations for vLLM, SGLang, and TRT-LLM across GPU topologies (GB200, B200, DGX Spark), including MTP speculative decoding, expert parallelism, and tuning guidance.
16+
- **[AdvancedDeploymentGuide](AdvancedDeploymentGuide/README.md)** — Production deployment configurations for vLLM, SGLang, and TRT-LLM across GPU topologies (GB200, B200, DGX Spark), including MTP speculative decoding, expert parallelism, and tuning guidance.
1717

1818
### Fine-Tuning
1919

20-
- **{doc}`grpo-dapo <grpo-dapo/README>`** — Full-weight RL training with GRPO/DAPO algorithm, reproducing emergent math reasoning from a base model.
21-
- **{doc}`lora-text2sql <lora-text2sql/README>`** — Supervised fine-tuning (LoRA) recipe for the Text2SQL use case, including dataset preparation and training with [NeMo Megatron-Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge) and [NeMo AutoModel](https://github.com/NVIDIA-NeMo/Automodel) libraries.
20+
- **[grpo-dapo](grpo-dapo/README.md)** — Full-weight RL training with GRPO/DAPO algorithm, reproducing emergent math reasoning from a base model.
21+
- **[lora-text2sql](lora-text2sql/README.md)** — Supervised fine-tuning (LoRA) recipe for the Text2SQL use case, including dataset preparation and training with [NeMo Megatron-Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge) and [NeMo AutoModel](https://github.com/NVIDIA-NeMo/Automodel) libraries.
2222

2323
### Agentic
2424

25-
- **{doc}`OpenScaffoldingResources <OpenScaffoldingResources/README>`** — Guides for using Nemotron-3-Super with agentic coding tools (OpenCode, OpenClaw, Kilo Code CLI, OpenHands) via OpenRouter and build.nvidia.com.
25+
- **[OpenScaffoldingResources](OpenScaffoldingResources/README.md)** — Guides for using Nemotron-3-Super with agentic coding tools (OpenCode, OpenClaw, Kilo Code CLI, OpenHands) via OpenRouter and build.nvidia.com.

usage-cookbook/Nemotron-3-Super/lora-text2sql/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This directory demonstrates customizing Nemotron-3-Super for the Text2SQL use ca
66

77
This directory contains two distinct LoRA fine-tuning tutorials for Text2SQL:
88

9-
- {doc}`nemo-megatron-bridge <nemo-megatron-bridge/README>` — Recipe using [NeMo Megatron-Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge)
10-
- {doc}`nemo-automodel <nemo-automodel/README>` — Recipe using [NeMo AutoModel](https://github.com/NVIDIA-NeMo/Automodel)
9+
- [nemo-megatron-bridge](nemo-megatron-bridge/README.md) — Recipe using [NeMo Megatron-Bridge](https://github.com/NVIDIA-NeMo/Megatron-Bridge)
10+
- [nemo-automodel](nemo-automodel/README.md) — Recipe using [NeMo AutoModel](https://github.com/NVIDIA-NeMo/Automodel)
1111

1212
## Requirements
1313

0 commit comments

Comments
 (0)