Skip to content

Commit 39d2f4d

Browse files
authored
Checkout release branch in docs (#1128)
## Summary Checkout release branch in docs ## Detailed description - Addresses: [6434852](https://nvbugspro.nvidia.com/bug/6434852) - Adds a macro that ensures that the checkout command points to the correct branch. --------- Signed-off-by: Alex Millane <amillane@nvidia.com>
1 parent f6341f0 commit 39d2f4d

3 files changed

Lines changed: 9 additions & 22 deletions

File tree

docs/_ext/isaaclab_arena_doc_tools.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,18 @@
2020

2121

2222
def isaaclab_arena_git_clone_code_block(app: Sphinx, _: Any, source: list[str]) -> None:
23-
"""Replaces the :isaaclab_arena_git_clone_code_block: directive with a code block.
24-
The output git clone command depends on whether we're in release or internal mode.
25-
"""
23+
"""Replaces the :isaaclab_arena_git_clone_code_block: directive with a code block."""
2624

2725
def replacer(_: Any) -> str:
28-
release_state = app.config.isaaclab_arena_docs_config["released"]
29-
internal_git_url = app.config.isaaclab_arena_docs_config["internal_git_url"]
30-
external_git_url = app.config.isaaclab_arena_docs_config["external_git_url"]
31-
if release_state:
32-
git_clone_target = external_git_url
33-
else:
34-
git_clone_target = internal_git_url
35-
print(f"git_clone_target: {git_clone_target}")
26+
git_url = app.config.isaaclab_arena_docs_config["git_url"]
27+
# smv_current_version is the ref of a per-version build; empty for local `make html`.
28+
docs_ref = getattr(app.config, "smv_current_version", "") or "main"
29+
repo_dir = git_url.rstrip("/").rsplit("/", 1)[-1].removesuffix(".git")
3630
return f"""
3731
.. code-block:: bash
3832
39-
git clone {git_clone_target}
33+
git clone --branch {docs_ref} --recurse-submodules {git_url}
34+
cd {repo_dir}
4035
4136
"""
4237

docs/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@
164164

165165
isaaclab_arena_docs_config = {
166166
"released": released,
167-
"internal_git_url": "git@github.com:isaac-sim/IsaacLab-Arena.git",
168-
"external_git_url": "UNDECIDED",
167+
"git_url": "git@github.com:isaac-sim/IsaacLab-Arena.git",
169168
"internal_code_link_base_url": "https://github.com/isaac-sim/IsaacLab-Arena",
170169
"external_code_link_base_url": "UNDECIDED",
171170
}

docs/pages/quickstart/installation.rst

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ Both flavors follow the same workflow — clone, sync, activate, run; only the
5454

5555
Clone the repository:
5656

57-
.. code-block:: bash
58-
59-
git clone --recurse-submodules https://github.com/isaac-sim/IsaacLab-Arena.git
60-
cd IsaacLab-Arena
57+
:isaaclab_arena_git_clone_code_block:
6158

6259
Sync the environment and activate it, picking the flavor that matches your
6360
workflow:
@@ -162,10 +159,6 @@ installation options.
162159

163160
:isaaclab_arena_git_clone_code_block:
164161

165-
.. code-block:: bash
166-
167-
git submodule update --init --recursive
168-
169162
2. **Launch the docker container:**
170163

171164
:docker_run_default:

0 commit comments

Comments
 (0)