text
tit.reporting.reportlets.text ¶
Text-based reportlets for TI-Toolbox reports.
This module provides reportlets for displaying text content, including methods boilerplate text for publications.
MethodsBoilerplateReportlet ¶
MethodsBoilerplateReportlet(title: str | None = None, boilerplate_text: str | None = None, pipeline_type: str = 'simulation', parameters: dict[str, Any] | None = None)
Bases: BaseReportlet
Reportlet for displaying methods section boilerplate text.
Generates publication-ready text describing the methods used in the analysis, with a copy-to-clipboard button.
Initialize the methods boilerplate reportlet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str | None
|
Title for the section |
None
|
boilerplate_text
|
str | None
|
Pre-written boilerplate text |
None
|
pipeline_type
|
str
|
Type of pipeline (simulation, preprocessing, optimization) |
'simulation'
|
parameters
|
dict[str, Any] | None
|
Parameters to include in generated text |
None
|
Source code in tit/reporting/reportlets/text.py
generate_boilerplate ¶
generate_boilerplate() -> str
Generate boilerplate text based on pipeline type and parameters.
Returns:
| Type | Description |
|---|---|
str
|
Generated boilerplate text |
Source code in tit/reporting/reportlets/text.py
render_html ¶
render_html() -> str
Render the boilerplate text as HTML.
Source code in tit/reporting/reportlets/text.py
DescriptionReportlet ¶
Bases: BaseReportlet
Reportlet for displaying descriptive text content.
Renders paragraphs of text with optional formatting.
Initialize the description reportlet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
str
|
Text content to display |
required |
title
|
str | None
|
Optional section title |
None
|
format_type
|
str
|
How to format content (paragraphs, html, preformatted) |
'paragraphs'
|
Source code in tit/reporting/reportlets/text.py
render_html ¶
render_html() -> str
Render the description text as HTML.
Source code in tit/reporting/reportlets/text.py
CommandLogReportlet ¶
Bases: BaseReportlet
Reportlet for displaying command execution logs.
Shows commands that were run with their outputs in a terminal-like display.
Initialize the command log reportlet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str | None
|
Optional section title |
None
|
commands
|
list[dict[str, str]] | None
|
List of command dicts with 'command' and optional 'output' |
None
|
Source code in tit/reporting/reportlets/text.py
add_command ¶
Add a command to the log.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command
|
str
|
The command that was executed |
required |
output
|
str | None
|
Command output (if any) |
None
|
status
|
str
|
Execution status (success, error) |
'success'
|
Source code in tit/reporting/reportlets/text.py
render_html ¶
render_html() -> str
Render the command log as HTML.