import pathlib
d = pathlib.Path(__file__).parent
shell = (d/'shell.html').read_text()
a = (d/'a.html').read_text()
b = (d/'b.html').read_text() if (d/'b.html').exists() else '<div class="pb" data-concept="b" style="padding:32px">Förslag B är inte klart än.</div><script>window.protoB={show(){}}</script>'
out = shell.replace('<!--A-->', a).replace('<!--B-->', b)
(d/'index.html').write_text(out)
# local preview needs a real document skeleton and the artifact's reset
(d/'preview.html').write_text('<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><style>body{margin:0;font:14px system-ui;background:#fafafa}img{max-width:100%}[hidden]{display:none!important}</style></head><body>' + out + '</body></html>')
print('index.html bytes', len(out))
