Skip to content

hertzforge.report.markdown

markdown

The subset of Markdown a report's text blocks are written in.

It is written here, as the viewers are, so that no third-party code is carried inside a report. The subset is what a test report uses: headings with # to ####, bold, italic, code, bullet lists (- or *), numbered lists (1. or 1)), and paragraphs separated by blank lines. The text is HTML-escaped first, so HTML typed into a text block is shown as text, not interpreted.

Pipe tables are read when asked for (to_html(..., tables=True), which the report feature skeleton_sections does, so a section's author can type the table a section asks for): a header row, a delimiter row of dashes with optional colons for alignment, and body rows, each line opening and closing with |. A backslash before a pipe makes it part of a cell.

Functions:

Name Description
to_html

The Markdown subset in text as an HTML string.

Functions:

to_html

to_html(text: str, tables: bool = False) -> str

The Markdown subset in text as an HTML string.

A heading becomes h2 to h5, since h1 is the report's title. Lines of one paragraph are kept as lines, joined with
. With tables, pipe tables are read; without, a pipe is text like any other.