Report.add_html

add_html

add_html(html: str, *, title: str = '', caption: str | None = None, notes: str | None = None, id: str | None = None) -> ReportItem

Add a html snippet.

Parameters:
  • html (str) –

    html fragment to insert without modification

  • title (str, default: '' ) –

    optional visible heading

  • caption (str | None, default: None ) –

    optional caption

  • notes (str | None, default: None ) –

    optional explanatory notes

  • id (str | None, default: None ) –

    optional stable component id

Example

report.add_html(
    '<p>Results are <strong>preliminary</strong>.</p>',
    title='Interpretation',
)

HTML fragments are inserted without escaping, sanitization, or modification. Only include trusted HTML. Use Report.add_text() for ordinary text that should be escaped.

External HTML may bring its own styles, scripts, or resource dependencies. The caller is responsible for internal HTML identifiers and resource availability. HTML components cannot be regenerated from JSON report recipes.

← Reports API