"""Build a standalone frozen replay from this fork's renderer sources.""" from pathlib import Path import re root=Path(__file__).resolve().parent dist=root/'dist' if (root/'dist').exists() else root.parent/'web' app=(root/'app-source.js').read_text(encoding='utf-8').replace('/* @renderer */',(root/'renderer-functions.js').read_text(encoding='utf-8')).replace('/* @interaction */',(root/'interaction-functions.js').read_text(encoding='utf-8')) (dist/'app.js').write_text(app,encoding='utf-8') html=re.sub(r'\?v=[a-zA-Z0-9-]+','',(dist/'index.html').read_text(encoding='utf-8')) html=html.replace('','') html=html.replace('','') for name in ['production','topology','filaments','app','interface']: script=(dist/(name+'.js')).read_text(encoding='utf-8') html=html.replace('','') template=html.replace('