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

Function read_front_matter

scripts/generate_docs_index.py:142–154  ·  view source on GitHub ↗

Parse YAML front matter from a Markdown file.

(md_file: Path)

Source from the content-addressed store, hash-verified

140
141
142def read_front_matter(md_file: Path) -> Optional[dict]:
143 """Parse YAML front matter from a Markdown file."""
144 try:
145 content = md_file.read_text(encoding="utf-8")
146 if not content.startswith("---"):
147 return None
148 end = content.find("---", 3)
149 if end == -1:
150 return None
151 fm_str = content[3:end].strip()
152 return yaml.safe_load(fm_str)
153 except Exception:
154 return None
155
156
157def get_doc_entries(data_dir: Path, section_key: str) -> List[dict]:

Callers 4

get_doc_entriesFunction · 0.85
sync_content_to_docsFunction · 0.85
sync_en_content_to_docsFunction · 0.85
get_en_entriesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected