Skip to main content

Crate code_ranker_viewer

Crate code_ranker_viewer 

Source
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 a Snapshot. Returns None if the tag is absent or holds null.
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 (see extract_embedded_snapshot). current only → review; both → diff.