hertzforge.report.viewer¶
viewer
¶
A report written as the shell's own page (step 4 of the reports plan).
viewer.html is the viewer the UI builds alone (npm --prefix ui run
build:report): ReportPage and the shell's viz kit, with their script,
styles and fonts inlined. viewer_html fills in a report's title and its
blocks (views.page_blocks) as one protocol frame, base64, so the file is
one page that opens offline in any browser and draws the report as the app
does.
Functions:
| Name | Description |
|---|---|
viewer_page |
The viewer as the UI built it, with nothing filled in. |
viewer_html |
The report as one self-contained HTML page drawn by the shell's own |
read_viewer |
The report a page from |
page_text |
The words a page from |
Functions:¶
viewer_html
¶
viewer_html(report: Any, objects: Mapping[str, Any], unit_system: Any = None, object_groups: Any = None, theme: str | None = None) -> str
The report as one self-contained HTML page drawn by the shell's own
viewers: its blocks (views.page_blocks) in unit_system, in the
light or dark theme (the reader's own when None), for the reader
to switch.
read_viewer
¶
The report a page from viewer_html holds: {'name', 'title',
'marking', 'blocks'}, its views' arrays as numpy arrays. A page with
no report raises ValueError.
page_text
¶
The words a page from viewer_html shows, one line each: its title,
marking and stylesheet, and each block's text, number, caption and note,
its tables' cells and its readings' rows. What a reader can search for,
and what a test looks for.