MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / replace_cli_link

Function replace_cli_link

scripts/docs/postprocess_nedoc.py:86–97  ·  view source on GitHub ↗
(match)

Source from the content-addressed store, hash-verified

84
85def on_page_markdown(markdown: str, page, config, *args, **kwargs):
86 def replace_cli_link(match):
87 global api_links
88 link_text = match.group(1)
89 pyapi_key = match.group(2)
90 hash = match.group(3) or ""
91 link_url = url_map.get(pyapi_key)
92 if link_url:
93 api_links += 1
94 pyapi_url = f"{site_url}{link_url}"
95 return f"[{link_text}]({pyapi_url}{hash})"
96 else:
97 raise Exception(f"PyAPI link key {pyapi_key} not found in {page.file.src_path}")
98
99 return PYAPI_LINK_REGEX.sub(replace_cli_link, markdown)
100

Callers

nothing calls this directly

Calls 2

groupMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected