Adds per-branch cloning command to docs#5952
Conversation
There was a problem hiding this comment.
📝 Review: Adds per-branch cloning command to docs
Overall Assessment: ✅ Looks Good
This is a well-designed documentation improvement that replaces duplicated clone instructions across 3 pages with a single, maintainable Sphinx directive that dynamically generates version-aware clone commands.
What This PR Does
- Introduces a new Sphinx extension (
docs/_extensions/isaaclab_docs.py) with a custom.. isaaclab-clone-commands::directive - The directive generates SSH/HTTPS clone tab-sets with
--branch <version>automatically resolved fromsphinx-multiversionor theISAACLAB_LATEST_BRANCHenv var - Replaces hardcoded clone blocks in 3 RST files, reducing duplication and ensuring branch consistency across versioned docs
Observations
-
Good design choice: Using
smv_current_versionfrom sphinx-multiversion as the primary branch source means each versioned doc build will reference the correct branch without manual updates. -
cd IsaacLabaddition: The new directive addscd IsaacLabafter the clone command, which is a helpful improvement for users following along — previously they had to figure this out themselves. -
rst_prologsubstitution: The|isaaclab_latest_branch|substitution is defined inconf.pybut not currently used in any RST file in this PR. This is presumably for future use or other docs pages — just flagging for awareness. -
Extension metadata: The extension correctly declares
parallel_read_safe: Trueandparallel_write_safe: True, which is good for build performance. -
CI: Pre-commit checks pass. Doc build is still pending at time of review.
Minor Suggestion (Non-blocking)
The directive uses code-block:: bash while the previous inline code used code:: bash. This is fine (both work), and code-block is the more explicit/modern form — just noting the consistency improvement.
No issues found. Clean, well-scoped documentation improvement. 👍
Update (c7a808f): New commits fix Isaac ROS documentation URLs (isaac_manipulator_ur_dnn_policy → isaac_ros_manipulation_ur_dnn_policy) and update the ThreeDWorld link to the active GitHub repo. Changes look correct — no new issues.
Update (9476d9a): Branch synced with main — brings in the merged rsl-rl checkpoint deprecation fix (PR #5953). No changes to the documentation files in this PR's scope. No new issues.
Greptile SummaryThis PR centralises the Isaac Lab repository clone commands into a custom Sphinx extension (
Confidence Score: 4/5Documentation-only change that is safe to merge; the new Sphinx extension is straightforward and the RST substitutions are mechanical. The core logic is simple and correct. Two minor observations — an unused rst_prolog substitution and the quietly-added cd IsaacLab step — do not affect correctness but are worth a quick author check before merging. docs/_extensions/isaaclab_docs.py and docs/conf.py are the only files that warrant a second look, specifically around the unused substitution and the newly added cd IsaacLab in the generated clone commands. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Sphinx build starts] --> B{sphinx-multiversion?}
B -- Yes --> C[smv_current_version = branch/tag name]
B -- No --> D[smv_current_version = empty string]
C --> E["_branch() returns smv_current_version"]
D --> F["_branch() reads isaaclab_latest_branch config"]
F --> G{ISAACLAB_LATEST_BRANCH env var set?}
G -- Yes --> H[Use env var value]
G -- No --> I[Default to 'main']
E --> J["IsaacLabCloneCommands.run() generates RST"]
H --> J
I --> J
J --> K["tab-set with --branch injected into SSH & HTTPS code blocks"]
K --> L[Rendered HTML docs]
Reviews (1): Last reviewed commit: "Adds per-branch cloning command to docs" | Re-trigger Greptile |
| rst_prolog = f""" | ||
| .. |isaaclab_latest_branch| replace:: {isaaclab_latest_branch} | ||
| """ |
There was a problem hiding this comment.
Unused
rst_prolog substitution
The |isaaclab_latest_branch| substitution is defined here but none of the RST files changed in this PR (or the existing clone instruction files) appear to reference it. The actual branch injection is handled entirely by the IsaacLabCloneCommands Python directive. If this substitution is intended for future inline prose use across other RST files (e.g. "clone branch |isaaclab_latest_branch|"), that's fine — but it's worth confirming it won't go stale since it's sourced from the same ISAACLAB_LATEST_BRANCH env var and will silently render as the literal pipe-delimited string if referenced in a file that doesn't include the prolog.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| def run(self) -> list[nodes.Node]: | ||
| branch = _branch(self.config) | ||
| content = f"""\ | ||
| .. tab-set:: | ||
|
|
||
| .. tab-item:: SSH | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| git clone git@github.com:isaac-sim/IsaacLab.git --branch {branch} | ||
| cd IsaacLab | ||
|
|
||
| .. tab-item:: HTTPS | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| git clone https://github.com/isaac-sim/IsaacLab.git --branch {branch} | ||
| cd IsaacLab | ||
| """ | ||
| return _parse_rst(self, content) |
There was a problem hiding this comment.
cd IsaacLab is a new, undocumented behaviour change
The previous inline code:: blocks showed only the git clone command. This directive now appends cd IsaacLab to both SSH and HTTPS variants. In the deployment/container context (deployment/index.rst) the text that follows the clone block does not assume the working directory is IsaacLab, so readers may find the extra step confusing or superfluous there. If the intent is to always include cd IsaacLab, the PR description should mention it; if it is incidental, consider dropping the cd from the generated content.
Description
Apply doc update that specifies the branch to be used for cloning commands to main.
We previously added this to develop, but it appears content is getting overwritten from other branches.
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there