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

Function load_source_urls

scripts/run_mdcg_conversion.py:46–59  ·  view source on GitHub ↗

Load source URLs from .zh.md front matter.

()

Source from the content-addressed store, hash-verified

44
45
46def load_source_urls():
47 """Load source URLs from .zh.md front matter."""
48 urls = {}
49 mdcg_dir = REPO_ROOT / "eu_mdr" / "mdcg"
50 for f in mdcg_dir.glob("*.zh.md"):
51 doc_id = f.stem.replace(".zh", "")
52 content = f.read_text(encoding="utf-8")
53 for line in content.split("\n"):
54 if line.startswith("source_url:"):
55 url = line.split("source_url:", 1)[1].strip()
56 if url and url.startswith("http"):
57 urls[doc_id] = url
58 break
59 return urls
60
61
62def convert_one(doc_id: str, source_url: str, converter: DocumentConverter):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected