jellycell.tearsheets._template¶
Shared header + helper rendering for :mod:jellycell.tearsheets.
Every helper in :mod:jellycell.tearsheets emits a manuscript-style
markdown file with a consistent, pinnable header block so the output
is byte-stable across runs when the caller passes
template_overrides (author, month_year, version, author_url).
Kept private; the public surface is the three helper functions in
- mod:
jellycell.tearsheets(findings,methodology,audit).
Module Contents¶
Functions¶
Merge caller overrides over defaults, filling |
|
Render the top-of-file header shared across all tearsheet helpers. |
|
Render a two-column markdown table from |
|
Emit a plain JSON block that’s machine-parseable and GitHub-renderable. |
|
Resolve + create parent directories for an output path. |
Data¶
API¶
- jellycell.tearsheets._template.resolve_template_fields(overrides: dict[str, str] | None) dict[str, str]¶
Merge caller overrides over defaults, filling
month_yearfrom now if absent.
- jellycell.tearsheets._template.render_header(*, kind: str, title: str, subtitle: str, project: str, template_overrides: dict[str, str] | None) str¶
Render the top-of-file header shared across all tearsheet helpers.
kindis one offindings/methodology/auditand shows up in an HTML comment so regeneration origin is obvious. The header line carries project name, author (+ optional URL), month_year, and jellycell version — all pinnable viatemplate_overridesfor byte-stable regen.
- jellycell.tearsheets._template.render_key_value_table(rows: dict[str, Any], *, key_header: str = 'Metric') str¶
Render a two-column markdown table from
{key: value}pairs.Values are formatted with :func:
_format_value— bools / numbers get inline code ticks, lists collapse to[n items]when long,Nonebecomesnull. Nested dicts flatten with dotted keys so{"cs": {"att": 0.2}}becomes acs.attrow.
- jellycell.tearsheets._template.render_frontmatter_block(fields: dict[str, str]) str¶
Emit a plain JSON block that’s machine-parseable and GitHub-renderable.
Some teams pin extra metadata (PR number, DOI, dataset snapshot id) beyond the header fields. This block lets downstream tooling recover those values without re-parsing the header.
- jellycell.tearsheets._template.ensure_output_path(out_path: str | pathlib.Path) pathlib.Path¶
Resolve + create parent directories for an output path.