MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / get_existing_frontmatter

Function get_existing_frontmatter

examples/generate_documentation.py:101–115  ·  view source on GitHub ↗

Extract existing frontmatter if it has special configurations.

(mdx_path)

Source from the content-addressed store, hash-verified

99
100
101def get_existing_frontmatter(mdx_path):
102 """Extract existing frontmatter if it has special configurations."""
103 if not mdx_path.exists():
104 return None
105
106 content = mdx_path.read_text(encoding="utf-8")
107
108 # Check for special configurations and extract frontmatter
109 if any(config in content for config in ["mode:", "layout:"]):
110 if content.startswith("---\n"):
111 end_marker = content.find("\n---\n", 4)
112 if end_marker != -1:
113 return content[4:end_marker]
114
115 return None
116
117
118def generate_mdx_content(notebook_path, processed_content, frontmatter=None):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…