MCPcopy Create free account
hub / github.com/mkdocstrings/griffe / _render_api

Function _render_api

scripts/gen_structure_docs.py:46–58  ·  view source on GitHub ↗
(path: Path, root: Path, heading_level: int = 4)

Source from the content-addressed store, hash-verified

44
45
46def _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
61def render_internal_api(heading_level: int = 4) -> None:

Callers 1

render_internal_apiFunction · 0.85

Calls 2

_comment_blockFunction · 0.85
_render_call_graphFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…