Skip to content

Commit 3931d93

Browse files
balogh.adam@icloud.comclaude
authored andcommitted
Fix dead links for namespace variables in generated docs
resolve_namespace_target was only using the last segment of the module path, producing broken links like ./llm instead of ./client/llm when rendering the top-level index. Now computes a proper relative path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ddfe7a8 commit 3931d93

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

docs/opengradient/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ def __init__(private_key: str, email: Optional[str] = None, password: Optio
140140

141141
#### Variables
142142

143-
* [**`inference`**](./onchain_inference): On-chain ONNX model inference via blockchain smart contracts.
144-
* [**`llm`**](./llm): LLM chat and completion via TEE-verified execution.
145-
* [**`model_hub`**](./model_hub): Model Hub for creating, versioning, and uploading ML models.
146-
* [**`alpha`**](./alpha): Alpha Testnet features including workflow management and ML model execution.
143+
* [**`inference`**](./client/onchain_inference): On-chain ONNX model inference via blockchain smart contracts.
144+
* [**`llm`**](./client/llm): LLM chat and completion via TEE-verified execution.
145+
* [**`model_hub`**](./client/model_hub): Model Hub for creating, versioning, and uploading ML models.
146+
* [**`alpha`**](./client/alpha): Alpha Testnet features including workflow management and ML model execution.
147147

148148
### `InferenceMode`
149149

templates/text.mako

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,16 @@ def resolve_namespace_target(v):
6868
"""If v's type resolves to an opengradient class in a different module, return link target."""
6969
result = [None]
7070
var_mod = v.module.name if hasattr(v, 'module') and v.module else ''
71+
cur_parts = var_mod.split('.')
7172
def capture(dobj):
7273
if not isinstance(dobj, pdoc.Module) and hasattr(dobj, 'module') and dobj.module is not None:
7374
mod_parts = dobj.module.name.split('.')
7475
if (len(mod_parts) >= 2 and mod_parts[0] == 'opengradient'
7576
and dobj.module.name != var_mod):
76-
result[0] = mod_parts[-1] if len(mod_parts) > 2 else mod_parts[1]
77+
common = sum(1 for a, b in zip(cur_parts, mod_parts) if a == b)
78+
remaining = mod_parts[common:]
79+
if remaining:
80+
result[0] = '/'.join(remaining)
7781
return '`{}`'.format(dobj.qualname.split('.')[-1])
7882
if show_type_annotations:
7983
v.type_annotation(link=capture)

0 commit comments

Comments
 (0)