""" Self-contained, single-file HTML report. The output is a single .html with all CSS and JS inlined: no external network requests, opens cleanly with `open report.html` on any OS, supports light/dark theme via prefers-color-scheme + manual toggle, and offers per-section filtering (Verified/Unverified/Unused for bib; Errors/Warnings/Info for LaTeX), full-text search, and inline highlighting of the offending substring on each LaTeX-quality issue. The page is driven from a JSON blob embedded into the HTML, so re-rendering or re-filtering is cheap. We deliberately avoid external libraries. The embedded JSON deliberately omits all source file paths β€” only counts (`bib_files_count`, `tex_files_count`) reach the page so reports can be shared without leaking local paths. """ from __future__ import annotations import html import json from datetime import datetime from pathlib import Path from typing import Any, Dict, Iterable, List, Optional # --------------------------------------------------------------------------- # Public entrypoint # --------------------------------------------------------------------------- def render_standalone_html(payload: Dict[str, Any]) -> str: """ Render a complete self-contained HTML report. `payload` shape (see ReportGenerator.build_payload): { "meta": { "generated_at": str, "bib_files_count": int, "tex_files_count": int, "template": str }, "summary": { ... bib + latex counts ... }, "entries": [ { ... per-bib-entry ... } ], "submission_results": [ { ... per-line LaTeX issues ... } ], "retractions": [ { entry_key, doi, type, notice_url, label } ], "url_findings": [ { entry_key, url, status, status_code, detail } ], "duplicates": [ [keys...], ... ], "missing_citations": [ "key1", "key2" ] } """ blob = json.dumps(payload, ensure_ascii=False).replace(" __TITLE__

πŸ›‘οΈ BibGuard Report

Loading…

Show: All 0 βœ“ Verified 0 ⚠ Unverified 0 πŸ—‘ Unused 0
Severity: All 0 πŸ”΄ Errors 0 🟑 Warnings 0 πŸ”΅ Info 0

🚫 Retractions

πŸ”— URL Liveness

"""