MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / write_md

Function write_md

scripts/json_to_markdown.py:195–205  ·  view source on GitHub ↗

Write markdown file. Returns True if content changed.

(path: Path, content: str, dry_run: bool = False)

Source from the content-addressed store, hash-verified

193
194
195def write_md(path: Path, content: str, dry_run: bool = False) -> bool:
196 """Write markdown file. Returns True if content changed."""
197 if path.exists():
198 old = path.read_text(encoding="utf-8")
199 if old.strip() == content.strip():
200 return False
201 if dry_run:
202 return True
203 path.parent.mkdir(parents=True, exist_ok=True)
204 path.write_text(content, encoding="utf-8")
205 return True
206
207
208# ---------------------------------------------------------------------------

Callers 3

generate_guidanceFunction · 0.85
generate_standardsFunction · 0.85
generate_shared_sectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected