Extract existing frontmatter if it has special configurations.
(mdx_path)
| 99 | |
| 100 | |
| 101 | def 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 | |
| 118 | def generate_mdx_content(notebook_path, processed_content, frontmatter=None): |
no outgoing calls
no test coverage detected
searching dependent graphs…