Module html
Expand description
Static-HTML report emitter (T11). 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 implementsserde::Serialize(every existing row type does) can be rendered with one writer function. No per-analysis duplication. - No build-time template engine: simple
&'static strtemplate with{{TOKEN}}placeholders. We don’t introduce askama / tera / handlebars as dependencies. - Print-friendly:
@media printCSS 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.
rowsis serialized to JSON and embedded; the in-template JS reads it to render the table at page load.