MCPcopy Create free account
hub / github.com/apache/fory / update_docs_readme

Function update_docs_readme

benchmarks/java/benchmark_report.py:302–316  ·  view source on GitHub ↗
(docs_output_dir: Path, section: str)

Source from the content-addressed store, hash-verified

300
301
302def update_docs_readme(docs_output_dir: Path, section: str) -> Path:
303 docs_readme = docs_output_dir / "README.md"
304 if docs_readme.exists():
305 content = docs_readme.read_text(encoding="utf-8").rstrip()
306 marker = "\n## Xlang Benchmark\n"
307 if marker in content:
308 prefix = content.split(marker, 1)[0].rstrip()
309 content = prefix + "\n\n" + section
310 else:
311 content = content + "\n\n" + section
312 else:
313 content = "# Java Benchmarks\n\n" + section
314 docs_readme.write_text(content.rstrip() + "\n", encoding="utf-8")
315 run_prettier(docs_readme)
316 return docs_readme
317
318
319def run_prettier(path: Path) -> None:

Callers 1

mainFunction · 0.85

Calls 1

run_prettierFunction · 0.85

Tested by

no test coverage detected