OptimAbstract / app.py
tlemagueresse
drop the header
d0df5e4
raw
history blame contribute delete
446 Bytes
import re
import gradio as gr
def remove_yaml_header(text):
"""Remove YAML header (front matter) from markdown text."""
pattern = r'^---\n[\s\S]*?\n---\n'
cleaned_text = re.sub(pattern, '', text)
return cleaned_text
with open("README.md", "r", encoding="utf-8") as f:
readme_content = f.read()
cleaned_readme = remove_yaml_header(readme_content)
app = gr.Blocks()
with app:
gr.Markdown(cleaned_readme)
app.launch()