sloc-report 1.5.66

HTML report rendering and headless-browser PDF export for oxide-sloc
Documentation

sloc-report

HTML report rendering and PDF export for oxide-sloc.

Overview

This crate handles all output rendering:

  • render_html(run) -> Result<String> — Askama-templated HTML report with light/dark theme, language charts, per-file breakdown, warning analysis, and animated coverage gauge cards (cov-gauge-card)
  • write_pdf_from_html(html, path) — spawns a locally installed headless Chromium-based browser, polls for file stability, 45 s timeout; PDF print uses 0.82 zoom, tighter chart spacing, and a single-column centred scatter chart
  • Browser discovery: checks Chrome, Edge, Brave, Vivaldi, and Opera on Windows and Linux paths
  • Set SLOC_BROWSER env var to override browser path; SLOC_BROWSER_NOSANDBOX=1 passes --no-sandbox (required in Docker)
  • Stat-chip components — summary strip used on multiple pages (test metrics, trend reports): compact value + label + exact-value sub-label + hover tooltip
  • Run-ID chipsposition:fixed banners repeat on every printed/PDF page; chips show click-to-copy tooltip on hover; print margins widen when report_header_footer is set
  • Support-opportunities table — Description and Example columns wrap with styled example-file badges
  • Per-file tableoverflow-y:scroll forced to keep scrollbar gutter permanently allocated; JS IIFE compensates padding for scrollbar track width; column widths corrected to sum to ~98%

Usage

This is an internal crate used by the oxide-sloc workspace. It is not intended for use outside this project. See the main project for documentation and releases.

# Install the tool instead:
cargo install oxide-sloc