MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / build_page

Function build_page

codeclash/replay/base.py:319–339  ·  view source on GitHub ↗

A complete, self-contained replay page (CSS + player + arena JS + data inlined). Built on demand by the server and served straight from memory — nothing is written to disk.

(data: ReplayData, tour: dict, renderer: ReplayRenderer)

Source from the content-addressed store, hash-verified

317 '<!doctype html><html><head><meta charset="utf-8">'
318 + head_extra
319 + "</head><body>\n"
320 + SHELL_BODY
321 + "\n"
322 + scripts
323 + "\n</body></html>\n"
324 )
325
326
327def build_page(data: ReplayData, tour: dict, renderer: ReplayRenderer) -> str:
328 """A complete, self-contained replay page (CSS + player + arena JS + data inlined).
329
330 Built on demand by the server and served straight from memory — nothing is written to
331 disk.
332 """
333 head = f"<title>{renderer.arena} replay</title><style>{SHELL_CSS}{renderer.CSS}</style>"
334 scripts = (
335 "<script>window.G="
336 + _script_safe(data.payload)
337 + ";window.TOUR="
338 + _script_safe(tour)
339 + ";</script>\n"
340 + "<script>"
341 + renderer.DRAW_JS
342 + "</script>\n"

Callers

nothing calls this directly

Calls 2

_script_safeFunction · 0.85
_docFunction · 0.85

Tested by

no test coverage detected