Skip to content

Commit 4ab0164

Browse files
Unify docs build into a single build, support proper multiversion links (#81)
* docs: unify sphinx build, fix multiversion links * Unify Sphinx build to build as one project instead of separate User Guide and Deployment Guide builds * Change hard-coded URLs to use Sphinx roles so the correct multiversion link can be interpolated at build time The goal of this change is to make the links in our docs version-aware after moving to multiversion docs in #40. Normally the way to do this is to reference roles like `:doc:` and `:ref:` instead of hard-coding URLs, but since we have cross-guide links we also have to unify the Sphinx build to make the builds aware of roles across all our docs. Co-authored-by: RyaliNvidia <[email protected]> --------- Co-authored-by: RyaliNvidia <[email protected]>
1 parent 416d16e commit 4ab0164

File tree

35 files changed

+177
-204
lines changed

35 files changed

+177
-204
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ SPDX-License-Identifier: Apache-2.0
2323
### Workflow Orchestration Purpose-built for Physical AI
2424

2525
<a href="LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License"></a>
26-
<a href="https://nvidia.github.io/OSMO/user_guide"><img src="https://img.shields.io/badge/docs-latest-brightgreen.svg" alt="Documentation"></a>
26+
<a href="https://nvidia.github.io/OSMO/main/user_guide"><img src="https://img.shields.io/badge/docs-latest-brightgreen.svg" alt="Documentation"></a>
2727
<a href="https://kubernetes.io/"><img src="https://img.shields.io/badge/Kubernetes-Native-326ce5.svg" alt="Kubernetes"></a>
2828

2929
<a href="#ready-to-begin">Get Started</a>
@@ -116,13 +116,13 @@ OSMO solves this [Three Computer Problem](https://blogs.nvidia.com/blog/three-co
116116
117117
| **What You Can Do** | **Example** |
118118
|---------------------|----------------------|
119-
| **Interactively develop** on remote GPU nodes with VSCode, SSH, or Jupyter notebooks | [Interactive Workflows](https://nvidia.github.io/OSMO/user_guide/main/workflows/interactive/index.html) |
120-
| **Generate synthetic data** at scale using Isaac Sim or custom simulation environments | [Isaac Sim SDG](https://nvidia.github.io/OSMO/user_guide/main/how_to/isaac_sim_sdg.html) |
121-
| **Train models** with diverse datasets across distributed GPU clusters | [Model Training](https://nvidia.github.io/OSMO/user_guide/main/how_to/training.html) |
122-
| **Train policies** for robots using data-parallel reinforcement learning | [Reinforcement Learning](https://nvidia.github.io/OSMO/user_guide/main/how_to/reinforcement_learning.html) |
123-
| **Validate models** in simulation with hardware-in-the-loop testing | [Hardware In The Loop](https://nvidia.github.io/OSMO/user_guide/main/tutorials/hardware_in_the_loop/index.html) |
124-
| **Transform and post-process data** for iterative improvement | [Working with Data](https://nvidia.github.io/OSMO/user_guide/main/tutorials/data/index.html) |
125-
| **Benchmark system software** on actual robot hardware (NVIDIA Jetson, custom platforms) | [Hardware Testing](https://nvidia.github.io/OSMO/user_guide/main/how_to/hil.html) |
119+
| **Interactively develop** on remote GPU nodes with VSCode, SSH, or Jupyter notebooks | [Interactive Workflows](https://nvidia.github.io/OSMO/main/user_guide/workflows/interactive/index.html) |
120+
| **Generate synthetic data** at scale using Isaac Sim or custom simulation environments | [Isaac Sim SDG](https://nvidia.github.io/OSMO/main/user_guide/how_to/isaac_sim_sdg.html) |
121+
| **Train models** with diverse datasets across distributed GPU clusters | [Model Training](https://nvidia.github.io/OSMO/main/user_guide/how_to/training.html) |
122+
| **Train policies** for robots using data-parallel reinforcement learning | [Reinforcement Learning](https://nvidia.github.io/OSMO/main/user_guide/how_to/reinforcement_learning.html) |
123+
| **Validate models** in simulation with hardware-in-the-loop testing | [Hardware In The Loop](https://nvidia.github.io/OSMO/main/user_guide/tutorials/hardware_in_the_loop/index.html) |
124+
| **Transform and post-process data** for iterative improvement | [Working with Data](https://nvidia.github.io/OSMO/main/user_guide/tutorials/data/index.html) |
125+
| **Benchmark system software** on actual robot hardware (NVIDIA Jetson, custom platforms) | [Hardware Testing](https://nvidia.github.io/OSMO/main/user_guide/how_to/hil.html) |
126126
127127
### Battle-Tested in Production
128128
@@ -135,7 +135,7 @@ OSMO is production-grade and proven at scale. Originally developed to power Phys
135135
Select one of the deployment options below depending on your needs and environment to get started
136136
137137
<div align="center">
138-
<a href="https://nvidia.github.io/OSMO/deployment_guide/main/introduction/whats_next.html">
138+
<a href="https://nvidia.github.io/OSMO/main/deployment_guide/introduction/whats_next.html">
139139
<img src="./docs/deployment_options.svg" width="85%"/>
140140
</a>
141141
</div>
@@ -146,11 +146,11 @@ Select one of the deployment options below depending on your needs and environme
146146
147147
| Resource | Description |
148148
|:---------|:------------|
149-
| 🚀 [**Local Deployment**](https://nvidia.github.io/OSMO/deployment_guide/main/appendix/deploy_local.html) | Run it locally on your workstation in 10 minutes |
150-
| 🛠️ [**Cloud Deployment**](https://nvidia.github.io/OSMO/deployment_guide/) | Deploy production grade on cloud providers |
151-
| 📘 [**User Guide**](https://nvidia.github.io/OSMO/user_guide/) | Tutorials, workflows, and how-to guides for developers |
149+
| 🚀 [**Local Deployment**](https://nvidia.github.io/OSMO/main/deployment_guide/appendix/deploy_local.html) | Run it locally on your workstation in 10 minutes |
150+
| 🛠️ [**Cloud Deployment**](https://nvidia.github.io/OSMO/main/deployment_guide/) | Deploy production grade on cloud providers |
151+
| 📘 [**User Guide**](https://nvidia.github.io/OSMO/main/user_guide/) | Tutorials, workflows, and how-to guides for developers |
152152
| 💡 [**Workflow Examples**](./workflows/) | Robotics workflow examples
153-
| 💻 [**Getting Started**](https://nvidia.github.io/OSMO/user_guide/main/getting_started/install/index.html) | Install command-line interface to get started |
153+
| 💻 [**Getting Started**](https://nvidia.github.io/OSMO/main/user_guide/getting_started/install/index.html) | Install command-line interface to get started |
154154
155155
## Community & Support
156156

deployments/charts/quick-start/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This Helm chart provides a complete OSMO deployment for trying OSMO. If you are
2222
OSMO, this is a good way to get a feel for OSMO without deploying in a CSP.
2323

2424
It is recommended to install this chart in a KIND cluster instead of a CSP. See
25-
[Local Deployment](https://nvidia.github.io/OSMO/deployment_guide/main/appendix/deploy_local.html) for
25+
[Local Deployment](https://nvidia.github.io/OSMO/main/deployment_guide/appendix/deploy_local.html) for
2626
detailed installation instructions.
2727

2828
## Prerequisites

deployments/charts/quick-start/templates/NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
osmo login http://quick-start.osmo --method=dev --username=testuser
2929

3030
4. Explore next steps:
31-
https://nvidia.github.io/OSMO/user_guide/getting_started/next_steps.html
31+
https://nvidia.github.io/OSMO/main/user_guide/getting_started/next_steps.html

deployments/charts/web-ui/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ This Helm chart deploys the OSMO UI service along with its required sidecars and
5353
| `services.ui.hostAliases` | Host aliases for custom DNS resolution | `[]` |
5454
| `services.ui.tolerations` | Tolerations for pod scheduling on tainted nodes | `[]` |
5555
| `services.ui.resources` | Resource limits and requests for the UI container | `{}` |
56-
| `services.ui.docsBaseUrl` | Documentation base URL users will see from the UI | `"https://nvidia.github.io/OSMO/user_guide/"` |
56+
| `services.ui.docsBaseUrl` | Documentation base URL users will see from the UI | `"https://nvidia.github.io/OSMO/main/user_guide/"` |
5757
| `services.ui.cliInstallScriptUrl` | CLI Installation Script URL displayed in the UI | `"https://raw.githubusercontent.com/NVIDIA/OSMO/refs/heads/main/install.sh"` |
5858

5959
### UI Scaling Settings

deployments/charts/web-ui/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ services:
115115

116116
## Documentation base URL
117117
##
118-
docsBaseUrl: "https://nvidia.github.io/OSMO/user_guide/"
118+
docsBaseUrl: "https://nvidia.github.io/OSMO/main/user_guide/"
119119

120120
## CLI Installation Script URL
121121
##

docs/BUILD

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -20,52 +20,26 @@ load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
2020

2121
package(default_visibility = ["//visibility:public"])
2222

23+
# Build all documentation as a unified Sphinx project
2324
filegroup(
24-
name = "root_docs_sources",
25-
srcs = glob([
26-
"_static/**",
27-
"_extensions/**",
28-
"conf.py",
29-
"index.rst",
30-
]),
31-
)
32-
33-
copy_to_directory(
34-
name = "root_docs_copy",
35-
srcs = [":root_docs_sources"],
36-
out = "root_docs",
37-
)
38-
39-
filegroup(
40-
name = "user_guide_sources",
25+
name = "all_docs_sources",
4126
srcs = glob([
4227
"_static/**",
4328
"_extensions/**",
4429
"_templates/**",
30+
"_redirect/**",
4531
"user_guide/**",
46-
"conf.py",
47-
]),
48-
)
49-
50-
copy_to_directory(
51-
name = "user_guide_copy",
52-
srcs = [":user_guide_sources"],
53-
out = "user_guide",
54-
)
55-
56-
filegroup(
57-
name = "deployment_guide_sources",
58-
srcs = glob([
59-
"_static/**",
60-
"_extensions/**",
61-
"_templates/**",
6232
"deployment_guide/**",
63-
"conf.py",
33+
"*.py",
34+
"*.rst",
35+
"*.svg",
36+
"*.png",
37+
"*.txt",
6438
]),
6539
)
6640

6741
copy_to_directory(
68-
name = "deployment_guide_copy",
69-
srcs = [":deployment_guide_sources"],
70-
out = "deployment_guide",
42+
name = "docs_copy",
43+
srcs = [":all_docs_sources"],
44+
out = "docs",
7145
)

docs/Makefile

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -35,50 +35,24 @@ clean:
3535
rm -rf _build
3636

3737
build:
38-
export OSMO_DOMAIN=public && sphinx-build -b html . -w $(ERR_DIR)/root.log $(OUT_DIR)
39-
export OSMO_DOMAIN=public && sphinx-build -b html user_guide -w $(ERR_DIR)/user_guide.log $(OUT_DIR)/user_guide
40-
export OSMO_DOMAIN=public && sphinx-build -b html deployment_guide -w $(ERR_DIR)/deployment_guide.log $(OUT_DIR)/deployment_guide
41-
export OSMO_DOMAIN=public && sphinx-build -b markdown user_guide $(OUT_DIR)/user_guide -w $(ERR_DIR)/user_guide_markdown.log
42-
export OSMO_DOMAIN=public && sphinx-build -b markdown deployment_guide $(OUT_DIR)/deployment_guide -w $(ERR_DIR)/deployment_guide_markdown.log
38+
export OSMO_DOMAIN=public && sphinx-build -b html . -w $(ERR_DIR)/build.log $(OUT_DIR)
39+
export OSMO_DOMAIN=public && sphinx-build -b markdown . -w $(ERR_DIR)/markdown.log $(OUT_DIR)
4340
rm -rf $(OUT_DIR)/_sources
44-
rm -rf $(OUT_DIR)/user_guide/_sources
45-
rm -rf $(OUT_DIR)/deployment_guide/_sources
4641

4742
build-multiversion:
48-
export OSMO_DOMAIN=public && sphinx-build -b html . -w $(ERR_DIR)/root.log $(OUT_DIR)
49-
export OSMO_DOMAIN=public && $(SPHINXBUILD) user_guide $(OUT_DIR)/user_guide
50-
export OSMO_DOMAIN=public && $(SPHINXBUILD) deployment_guide $(OUT_DIR)/deployment_guide
43+
export OSMO_DOMAIN=public && $(SPHINXBUILD) . $(OUT_DIR)
5144
rm -rf $(OUT_DIR)/_sources
52-
rm -rf $(OUT_DIR)/user_guide/_sources
53-
rm -rf $(OUT_DIR)/deployment_guide/_sources
54-
# Copy root redirect files
55-
@cp _redirect/redirect_user_guide.html $(OUT_DIR)/user_guide/index.html
56-
@cp _redirect/redirect_deployment_guide.html $(OUT_DIR)/deployment_guide/index.html
5745

58-
build-root-html:
59-
export OSMO_DOMAIN=public && sphinx-build -b html . -w $(ERR_DIR)/root.log $(OUT_DIR)
46+
build-html:
47+
export OSMO_DOMAIN=public && sphinx-build -b html . -w $(ERR_DIR)/build.log $(OUT_DIR)
6048
rm -rf $(OUT_DIR)/_sources
6149

6250

63-
build-user-html:
64-
export OSMO_DOMAIN=public && sphinx-build -b html user_guide -w $(ERR_DIR)/user_guide.log $(OUT_DIR)/user_guide
65-
rm -rf $(OUT_DIR)/user_guide/_sources
66-
67-
68-
build-deployment-html:
69-
export OSMO_DOMAIN=public && sphinx-build -b html deployment_guide -w $(ERR_DIR)/deployment_guide.log $(OUT_DIR)/deployment_guide
70-
rm -rf $(OUT_DIR)/deployment_guide/_sources
71-
72-
7351
spelling:
74-
export OSMO_DOMAIN=public && sphinx-build -b spelling -j auto -w $(ERR_DIR)/root.log -N . $(OUT_DIR)
75-
export OSMO_DOMAIN=public && sphinx-build -b spelling -j auto -w $(ERR_DIR)/user_guide.log -N user_guide $(OUT_DIR)/user_guide
76-
export OSMO_DOMAIN=public && sphinx-build -b spelling -j auto -w $(ERR_DIR)/deployment_guide.log -N deployment_guide $(OUT_DIR)/deployment_guide
52+
export OSMO_DOMAIN=public && sphinx-build -b spelling -j auto -w $(ERR_DIR)/spelling.log -N . $(OUT_DIR)
7753

7854
linkcheck:
7955
export OSMO_DOMAIN=public && sphinx-build -b linkcheck -w $(ERR_DIR)/root.log . $(OUT_DIR)
80-
export OSMO_DOMAIN=public && sphinx-build -b linkcheck -w $(ERR_DIR)/user_guide.log user_guide $(OUT_DIR)/user_guide
81-
export OSMO_DOMAIN=public && sphinx-build -b linkcheck -w $(ERR_DIR)/deployment_guide.log deployment_guide $(OUT_DIR)/deployment_guide
8256

8357
# Catch-all target: route all unknown targets to Sphinx using the new
8458
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
17+
"""Override NVIDIA theme's sidebar behavior to restore PyData defaults."""
18+
19+
# Store the original suppress_sidebar_toctree before NVIDIA overrides it
20+
_original_suppress_sidebar_toctree = {}
21+
22+
def capture_original_sidebar_logic(app, pagename, templatename, context, doctree):
23+
"""Capture PyData's original suppress_sidebar_toctree before NVIDIA overrides it."""
24+
# Store whatever PyData theme set (or didn't set)
25+
if pagename not in _original_suppress_sidebar_toctree:
26+
_original_suppress_sidebar_toctree[pagename] = context.get("suppress_sidebar_toctree")
27+
28+
def restore_original_sidebar_logic(app, pagename, templatename, context, doctree):
29+
"""Restore PyData's original suppress_sidebar_toctree after NVIDIA overrides it."""
30+
# Restore the original value that PyData set
31+
original_value = _original_suppress_sidebar_toctree.get(pagename)
32+
if original_value is not None:
33+
context["suppress_sidebar_toctree"] = original_value
34+
elif "suppress_sidebar_toctree" in context:
35+
# If PyData didn't set it, remove NVIDIA's override
36+
del context["suppress_sidebar_toctree"]
37+
38+
def setup(app):
39+
# Run at priority 999 to capture PyData's value before NVIDIA (which runs at 1000)
40+
app.connect("html-page-context", capture_original_sidebar_logic, priority=999)
41+
42+
# Run at priority 1001 to restore after NVIDIA has overridden it (which runs at 1000)
43+
app.connect("html-page-context", restore_original_sidebar_logic, priority=1001)
44+
45+
return {
46+
"version": "0.1",
47+
"parallel_read_safe": True,
48+
"parallel_write_safe": True,
49+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{#
2+
SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4+
5+
NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6+
property and proprietary rights in and to this material, related
7+
documentation and any modifications thereto. Any use, reproduction,
8+
disclosure or distribution of this material and related documentation
9+
without an express license agreement from NVIDIA CORPORATION or
10+
its affiliates is strictly prohibited.
11+
#}
12+
{# modified from https://github.com/pydata/pydata-sphinx-theme/blob/v0.16.1/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/sidebar-nav-bs.html #}
13+
{# see "PyData Sphinx Theme License" in the README #}
14+
{# further modified from nvidia-sphinx-theme==0.0.8 to remove startdepth=0 hardcode #}
15+
{# Displays the TOC-tree for all pages. #}
16+
<nav class="bd-docs-nav bd-links"
17+
aria-label="{{ _('Table of Contents') }}">
18+
<p class="bd-links__title" role="heading" aria-level="1">{{ _("Table of Contents") }}</p>
19+
<div class="bd-toc-item navbar-nav">
20+
{{- generate_toctree_html(
21+
"sidebar",
22+
show_nav_level=theme_show_nav_level | int,
23+
maxdepth=theme_navigation_depth | int,
24+
collapse=theme_collapse_navigation | tobool,
25+
includehidden=theme_sidebar_includehidden | tobool,
26+
titles_only=True
27+
)
28+
-}}
29+
</div>
30+
</nav>

docs/conf.py

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,12 @@
1616

1717
# -- Path setup --------------------------------------------------------------
1818

19-
import os
2019
import sys
20+
from pathlib import Path
2121

22-
sys.path.insert(0, os.path.abspath('..'))
23-
sys.path.insert(0, os.path.abspath('.'))
24-
25-
# Determine if we're building from a subdirectory or root
26-
# Use current working directory since subdir conf.py files import this file
27-
_cwd = os.getcwd()
28-
_is_subdir = os.path.basename(_cwd) in ['user_guide', 'deployment_guide']
22+
# Add the directory containing conf.py to the path so custom extensions can be found
23+
# This is important for sphinx-multiversion which runs from temporary directories
24+
sys.path.insert(0, str(Path(__file__).parent.resolve()))
2925

3026
# -- Project information -----------------------------------------------------
3127

@@ -59,6 +55,9 @@
5955
'_extensions.domain_config',
6056
'_extensions.html_translator_mixin',
6157
'_extensions.markdown_translator',
58+
59+
# Theme extension
60+
'_extensions.nvidia_theme_override',
6261
]
6362

6463
# Spelling
@@ -67,7 +66,7 @@
6766
]
6867
spelling_show_suggestions = True
6968
spelling_warning = True
70-
spelling_word_list_filename = '../spelling_wordlist.txt'
69+
spelling_word_list_filename = 'spelling_wordlist.txt'
7170

7271
# Linkcheck ignore
7372
linkcheck_ignore = [
@@ -106,14 +105,6 @@
106105
'**/*.in.rst', # Ignore files that are embedded in other files
107106
]
108107

109-
# When building from root, exclude everything in subdirectories
110-
# The index files will still be parsed for TOC but won't build full pages
111-
if not _is_subdir:
112-
exclude_patterns.extend([
113-
'user_guide/**',
114-
'deployment_guide/**',
115-
])
116-
117108
suppress_warnings = [
118109
'toc.excluded',
119110
]
@@ -128,22 +119,14 @@
128119
html_title = 'OSMO Documentation'
129120
html_show_sourcelink = False
130121

131-
if _is_subdir:
132-
html_favicon = '../_static/osmo_favicon.png'
133-
html_logo = '../_static/nvidia-logo-horiz-rgb-wht-for-screen.png'
134-
html_static_path = ['../_static']
135-
templates_path = ['../_templates']
136-
html_css_files_extra = []
137-
else:
138-
html_favicon = '_static/osmo_favicon.png'
139-
html_logo = '_static/nvidia-logo-horiz-rgb-wht-for-screen.png'
140-
html_static_path = ['_static']
141-
# Hide sidebar completely for root page
142-
html_sidebars = {
143-
"**": []
144-
}
145-
# Add custom CSS to hide sidebar and remove vertical bar
146-
html_css_files_extra = ['css/root_page.css']
122+
html_favicon = '_static/osmo_favicon.png'
123+
html_logo = '_static/nvidia-logo-horiz-rgb-wht-for-screen.png'
124+
html_static_path = ['_static']
125+
templates_path = ['_templates']
126+
127+
html_sidebars = {
128+
"index": [],
129+
}
147130

148131
html_theme_options = {
149132
"collapse_navigation": False,
@@ -168,10 +151,6 @@
168151
'https://cdn.jsdelivr.net/npm/glightbox/dist/css/glightbox.min.css',
169152
]
170153

171-
# Add extra CSS files for root page
172-
if 'html_css_files_extra' in dir() and html_css_files_extra:
173-
html_css_files.extend(html_css_files_extra)
174-
175154
# JavaScript files to include in the HTML output
176155
# Files are loaded in the order they appear in this list
177156
html_js_files = [
@@ -249,3 +228,6 @@
249228
smv_branch_whitelist = r'^main$|^release/.*$'
250229
smv_remote_whitelist = r'^origin$'
251230
smv_prefer_remote_refs = False
231+
232+
# Latest version
233+
smv_latest_version = 'main'

0 commit comments

Comments
 (0)