(path: Path, root: Path, heading_level: int = 4)
| 44 | |
| 45 | |
| 46 | def _render_api(path: Path, root: Path, heading_level: int = 4) -> None: |
| 47 | for module in sorted(path.iterdir()): |
| 48 | if module.name in ("__main__.py", "__init__.py"): |
| 49 | continue |
| 50 | rel_path = str(module.relative_to(root).with_suffix("")).replace("/", "-") |
| 51 | if module.suffix == ".py": |
| 52 | print(f"{'#' * heading_level} `{module.name}` {{#{rel_path}}}\n") |
| 53 | print(_comment_block(module)) |
| 54 | _render_call_graph(module) |
| 55 | elif module.is_dir() and module.joinpath("__init__.py").exists(): |
| 56 | print(f"{'#' * heading_level} `{module.name}` {{#{rel_path}}}\n") |
| 57 | print(_comment_block(module / "__init__.py")) |
| 58 | _render_api(module, root, heading_level + 1) |
| 59 | |
| 60 | |
| 61 | def render_internal_api(heading_level: int = 4) -> None: |
no test coverage detected
searching dependent graphs…