#!/usr/bin/env python3
"""
Injectira schools_geocoded.json u HTML template i generira finalni mapa-skole-2026.html
Pokrenuti NAKON geocode_schools.py

Pokretanje:
    python3 inject_data.py
"""

import json

with open("schools_geocoded.json", encoding="utf-8") as f:
    data = json.dumps(json.load(f), ensure_ascii=False)

with open("mapa-skole-template.html", encoding="utf-8") as f:
    html = f.read()

html = html.replace("JSON_DATA_PLACEHOLDER", data)

with open("mapa-skole-2026.html", "w", encoding="utf-8") as f:
    f.write(html)

print("✓ Generirano: mapa-skole-2026.html")