MCPcopy
hub / github.com/vinta/awesome-python / _heading_level

Function _heading_level

website/readme_parser.py:117–121  ·  view source on GitHub ↗

Return the numeric level for a heading node.

(node: SyntaxTreeNode)

Source from the content-addressed store, hash-verified

115
116
117def _heading_level(node: SyntaxTreeNode) -> int | None:
118 """Return the numeric level for a heading node."""
119 if node.type != "heading" or not node.tag.startswith("h"):
120 return None
121 return int(node.tag[1:])
122
123
124def _extract_description_children(nodes: list[SyntaxTreeNode]) -> list[SyntaxTreeNode]:

Callers 2

parse_sponsorsFunction · 0.85
parse_readmeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected