MCPcopy Index your code
hub / github.com/idank/explainshell / _mandoc_markdown

Function _mandoc_markdown

tests/evals/render/render_eval.py:125–140  ·  view source on GitHub ↗
(mandoc_path: str, manpage: Path)

Source from the content-addressed store, hash-verified

123
124
125def _mandoc_markdown(mandoc_path: str, manpage: Path) -> str:
126 result = subprocess.run(
127 [mandoc_path, "-T", "markdown", str(manpage)],
128 cwd=REPO_ROOT,
129 capture_output=True,
130 text=True,
131 check=False,
132 timeout=60,
133 )
134 if result.returncode != 0:
135 raise RuntimeError(
136 result.stderr.strip() or f"mandoc exited {result.returncode}"
137 )
138 if not result.stdout.strip():
139 raise RuntimeError("mandoc produced empty markdown")
140 return result.stdout.rstrip() + "\n"
141
142
143def _line_metrics(markdown: str) -> dict[str, Any]:

Callers 1

_render_pageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected