Skip to main content

Module html

Module html 

Expand description

Static-HTML report emitter. One self-contained HTML file per analysis run — embedded CSS + vanilla JS, no external CDN, no framework dependency.

§Design choices

  • Single-file output: the entire report is one HTML file with inline CSS and JS. Works offline, attaches cleanly to GitHub Actions artifacts, opens in any browser. No CDN dependency.
  • JSON-data embedding: the analysis rows are serialised to JSON inside a <script type="application/json"> block. The vanilla JS reads that block to render the table — no separate data file.
  • Generic over Serialize: any analysis row type that implements serde::Serialize (every existing row type does) can be rendered with one writer function. No per-analysis duplication.
  • No build-time template engine: simple &'static str template with {{TOKEN}} placeholders. We don’t introduce askama / tera / handlebars as dependencies.
  • Print-friendly: @media print CSS rules collapse the interactive controls so the report can be saved as PDF for sharing with non-technical stakeholders.

§What’s emitted

  • A header with the analysis name + repo path + run timestamp.
  • A scrollable table with sortable column headers (click to sort).
  • A simple text-filter input that filters rows by any column.
  • Footer with provenance signature (codelore version, schema version).

Sample output: ~50 KB for a 100-row report. Well under the 200 KB soft cap for clean GitHub Actions artifact attachment.

Functions§

write_html
Render any analysis row collection as a self-contained HTML report. rows is serialized to JSON and embedded; the in-template JS reads it to render the table at page load.