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

Function _write_index

scripts/docs/generate_node_library_reference.py:355–372  ·  view source on GitHub ↗
(output_dir: Path, modules: list[ModuleDoc])

Source from the content-addressed store, hash-verified

353
354
355def _write_index(output_dir: Path, modules: list[ModuleDoc]) -> None:
356 lines = [
357 frontmatter(
358 "Node.js Library Reference",
359 "Generated Node.js API reference for the nemo-relay-node package.",
360 2,
361 ),
362 "Generated from the local `crates/node` package exports and TypeScript declaration files.\n\n",
363 "## Entry Points\n\n",
364 ]
365
366 for module in modules:
367 lines.append(f"- [{module.import_path}]({BASE_URL}/{_slug(module.import_path)})")
368 if module.description:
369 lines.append(f": {_escape_text(module.description)}")
370 lines.append("\n")
371
372 (output_dir / "index.mdx").write_text("".join(lines), encoding="utf-8")
373
374
375def _write_doc(lines: list[str], doc: JsDoc) -> None:

Callers 1

generateFunction · 0.70

Calls 4

frontmatterFunction · 0.90
_slugFunction · 0.85
joinMethod · 0.80
_escape_textFunction · 0.70

Tested by

no test coverage detected