MCPcopy Create free account
hub / github.com/NVIDIA/NeMo-Relay / _output_relative

Function _output_relative

scripts/docs/generate_rust_library_reference.py:168–175  ·  view source on GitHub ↗
(crate_name: str, crate_dir: Path, html_path: Path)

Source from the content-addressed store, hash-verified

166
167
168def _output_relative(crate_name: str, crate_dir: Path, html_path: Path) -> Path:
169 crate_slug = _crate_slug(crate_name)
170 rel = html_path.relative_to(crate_dir)
171 parent_parts = [_slug_part(part) for part in rel.parent.parts]
172 if rel.name == "index.html":
173 return Path(crate_slug, *parent_parts, "index.mdx")
174 stem = rel.name.removesuffix(".html")
175 return Path(crate_slug, *parent_parts, f"{_slug_part(stem)}.mdx")
176
177
178def _url_relative(crate_name: str, crate_dir: Path, html_path: Path) -> Path:

Callers 1

_discover_pagesFunction · 0.85

Calls 2

_crate_slugFunction · 0.85
_slug_partFunction · 0.70

Tested by

no test coverage detected