(output_dir: Path, modules: list[ModuleDoc])
| 353 | |
| 354 | |
| 355 | def _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 | |
| 375 | def _write_doc(lines: list[str], doc: JsDoc) -> None: |
no test coverage detected