INNER CODE UNIT · Python
process_episode
DataTalksClub/datatalksclub.github.io · scripts/add_context_from_title.py:109
def process_episode(file_path):
"""
Process a single episode file: add 'context' field from 'title' if it doesn't exist.
Args:
file_path: Path to the markdown file
Returns:
bool: True if file was modified, False otherwise
"""
print(f"Processing: {file_path.name}")
# Read file
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()
# Extract YAML and content
try: