#!/usr/bin/env python3 """ Convert Markdown slides to HTML presentation """ import re from pathlib import Path def convert_md_to_html(md_file, output_file): """Convert Markdown to HTML presentation""" # Read markdown content with open(md_file, 'r', encoding='utf-8') as f: content = f.read() # Split by --- to get individual slides slides = content.split('\n---\n') # HTML template with reveal.js-like styling html = """ SPARKNET Presentation
""" # Process each slide slide_html = [] for i, slide in enumerate(slides): if not slide.strip(): continue # Check if it's a lead slide is_lead = '' in slide # Remove marp directives slide = re.sub(r'', '', slide, flags=re.DOTALL) slide = re.sub(r'^---.*?$', '', slide, flags=re.MULTILINE) # Convert markdown to HTML (basic conversion) slide = re.sub(r'^# (.*?)$', r'

\1

', slide, flags=re.MULTILINE) slide = re.sub(r'^## (.*?)$', r'

\1

', slide, flags=re.MULTILINE) slide = re.sub(r'^### (.*?)$', r'

\1

', slide, flags=re.MULTILINE) slide = re.sub(r'^#### (.*?)$', r'

\1

', slide, flags=re.MULTILINE) # Convert bold and italic slide = re.sub(r'\*\*(.*?)\*\*', r'\1', slide) slide = re.sub(r'\*(.*?)\*', r'\1', slide) # Convert lists slide = re.sub(r'^- (.*?)$', r'
  • \1
  • ', slide, flags=re.MULTILINE) slide = re.sub(r'(
  • .*?
  • )', r'', slide, flags=re.DOTALL) slide = re.sub(r'\s*
    1 /
    """ # Write HTML file with open(output_file, 'w', encoding='utf-8') as f: f.write(html) print(f"✓ Created HTML presentation: {output_file}") if __name__ == '__main__': md_file = Path('SPARKNET_Slides.md') html_file = Path('SPARKNET_Slides.html') if not md_file.exists(): print(f"Error: {md_file} not found") exit(1) convert_md_to_html(md_file, html_file) print(f"\nOpen {html_file} in your browser to view the presentation") print("Use arrow keys or buttons to navigate")