chore: Adding in standard OSS NVIDIA Sphinx install#139
chore: Adding in standard OSS NVIDIA Sphinx install#139aschilling-nv wants to merge 5 commits intoNVIDIA-AI-Blueprints:developfrom
Conversation
Signed-off-by: Andrew Schilling <aschilling@nvidia.com>
Greptile SummaryThis PR migrates the Sphinx documentation setup to the standard NVIDIA OSS Sphinx theme ( Key changes and findings:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["sphinx-build / sphinx-autobuild"] --> B["conf.py loads nvidia_sphinx_theme"]
B --> C["Extensions loaded"]
C --> C1["myst_parser"]
C --> C2["sphinx.ext.viewcode"]
C --> C3["sphinx.ext.napoleon"]
C --> C4["sphinx_copybutton"]
C --> C5["sphinx_design"]
C --> C6["sphinxmermaid"]
B --> D["MyST Parser options"]
D --> D1["myst_enable_extensions<br>(dollarmath, amsmath, colon_fence, etc.)"]
D --> D2["myst_fence_as_directive: mermaid"]
B --> E["Theme options"]
E --> E1["versions1.json → version switcher"]
E --> E2["public_docs_features: True"]
E --> E3["GitHub icon link"]
E1 --> F["versions1.json\nversion: 1.2.1\nurl: docs.nvidia.com/ai-blueprint/1.2.1/"]
B --> G["project.json\nname + version metadata"]
Last reviewed commit: 25ab73c |
|
|
||
| # -- Options for Mermaid ----------------------------------------------------- | ||
| # Configure mermaid diagrams | ||
| mermaid_version = "latest" # Use the latest version of mermaid |
There was a problem hiding this comment.
Pinning to "latest" mermaid version can cause unexpected breakage
mermaid_version = "latest" will always pull the newest Mermaid JS release at build time, which can silently introduce breaking syntax or rendering changes. Consider pinning to a specific version (e.g., "10.9.0") for reproducible documentation builds.
| mermaid_version = "latest" # Use the latest version of mermaid | |
| mermaid_version = "10.9.0" # Pin to a specific version for reproducibility |
There was a problem hiding this comment.
I'll leave this up to the team, happy to pin it to a version if needed.
Signed-off-by: Andrew Schilling <aschilling@nvidia.com>
| project = "NVIDIA AI-Q Blueprint" | ||
| copyright = "2025-2026, NVIDIA CORPORATION & AFFILIATES" | ||
| author = "NVIDIA" | ||
| copyright = "2025-%Y, NVIDIA Corporation" |
There was a problem hiding this comment.
%Y not substituted by standard Sphinx
copyright = "2025-%Y, NVIDIA Corporation" uses a strftime format string (%Y) but standard Sphinx treats the copyright variable as a plain string — it does not call strftime on it. As a result, the rendered docs footer will literally display "2025-%Y, NVIDIA Corporation" rather than the intended current year.
To produce a dynamic year, format it explicitly in Python:
| copyright = "2025-%Y, NVIDIA Corporation" | |
| copyright = f"2025-{__import__('datetime').date.today().year}, NVIDIA Corporation" |
Or use a static string matching the current release year:
| copyright = "2025-%Y, NVIDIA Corporation" | |
| copyright = "2025-2026, NVIDIA Corporation" |
If nvidia_sphinx_theme is known to apply strftime to this field, please add a comment to document that dependency.
| "sphinx-autobuild>=2025.8.25", | ||
| "nvidia-sphinx-theme>=0.0.9.post1", | ||
| "sphinx-design>=0.7.0", | ||
| "sphinxcontrib-mermaid>=2.0.1", |
There was a problem hiding this comment.
sphinxcontrib-mermaid added but not registered as an extension
sphinxcontrib-mermaid is added to the docs dependencies, but docs/source/conf.py only registers sphinxmermaid (from sphinx-mermaid) in its extensions list. The sphinxcontrib.mermaid extension is never enabled, so this dependency has no effect. Having two mermaid-related packages installed simultaneously can also cause import conflicts.
If sphinxcontrib-mermaid is not needed, remove it. If it is intended to replace sphinx-mermaid, also update conf.py to register sphinxcontrib.mermaid instead of sphinxmermaid and remove sphinx-mermaid from dependencies.
|
@aschilling-nv can you resolve lint issues in ci |
Signed-off-by: Andrew Schilling <aschilling@nvidia.com>
Signed-off-by: Andrew Schilling <aschilling@nvidia.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
| source_suffix = [".md"] | ||
|
|
||
| # Copy button: strip common prompts from copied code | ||
| copybutton_prompt_text = ">>> |$ " |
There was a problem hiding this comment.
Unescaped $ in copybutton regex won't match shell prompts
copybutton_prompt_text is treated as a regex pattern by sphinx-copybutton. In regex, $ is the end-of-line anchor — not a literal dollar sign. This means the pattern ">>> |$ " reads as: match >>> OR match "end-of-line followed by a space", which is impossible. As a result, shell prompt lines like $ some-command will not have their prompt stripped when users click the copy button.
The fix is to escape the dollar sign:
| copybutton_prompt_text = ">>> |$ " | |
| copybutton_prompt_text = r">>> |\$ " |
There was a problem hiding this comment.
I believe this project is using python in code blocks which doesn't require the r.
Keep in mind that the RegExp you are writing is evaluated in JavaScript and not in Python. In some edge cases this might lead to different results.
Done! |

Summary
standard NVIDIA OSS Sphinx theme (
nvidia_sphinx_theme) as the required themedocs/source/conf.pywith additional extensions (sphinx.ext.viewcode,sphinx.ext.napoleon,sphinx_design), richer MyST parser options (math, task lists,definition lists, etc.), and Mermaid diagram configuration
project.jsonandversions1.jsonto support the NVIDIA docs version switcherwidget and public docs features
pyproject.tomldoc dependencies:nvidia-sphinx-theme,sphinx-autobuild,sphinx-design, andsphinxcontrib-mermaidlinkcheck_ignoreto skip GitHub and raw GitHub URLs during link checks