Expand description
Self-contained HTML viewer for Code Ranker: embeds one or two snapshots into a single interactive HTML file (no CDN, no external requests), and extracts a snapshot back out of a generated report.
Functions§
- extract_
embedded_ snapshot - Pull the JSON out of
<script type="application/json" id="{id}">…</script>and parse it into aSnapshot. ReturnsNoneif the tag is absent or holdsnull. - render_
html_ viewer - Render a self-contained viewer with the snapshot data embedded inline. The
snapshots are stored in
<script type="application/json">tags (cs-baseline/cs-current) so they can be both read by the viewer and extracted from the HTML later (seeextract_embedded_snapshot).currentonly → review; both → diff.