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

Function extract_front_matter

scripts/validate_schema.py:57–65  ·  view source on GitHub ↗

Extract YAML front matter from Markdown file.

(md_content: str)

Source from the content-addressed store, hash-verified

55
56
57def extract_front_matter(md_content: str) -> dict | None:
58 """Extract YAML front matter from Markdown file."""
59 match = re.match(r"^---\n(.+?)\n---", md_content, re.DOTALL)
60 if not match:
61 return None
62 try:
63 return yaml.safe_load(match.group(1))
64 except yaml.YAMLError:
65 return None
66
67
68def get_schema_for_path(path: Path) -> str | None:

Callers 1

validate_md_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected