import os

INPUT_DIR = "./html"          # mappen der .html-filene ligger
OUTPUT_FILE = "combined.md"   # eller "combined.txt"
SEPARATOR = "\n\n--- FILE SEPARATOR ---\n\n"

def collect_html_files(input_dir, output_file):
    with open(output_file, "w", encoding="utf-8") as out:
        for filename in os.listdir(input_dir):
            if filename.lower().endswith(".html"):
                path = os.path.join(input_dir, filename)
                with open(path, "r", encoding="utf-8") as f:
                    content = f.read()

                out.write(f"# FILE: {filename}\n\n")
                out.write(content)
                out.write(SEPARATOR)

    print(f"✔ Ferdig! Alt samlet i: {output_file}")

collect_html_files(INPUT_DIR, OUTPUT_FILE)
