Skip to content

html

dandy.recorder.renderer.html

HtmlRecordingRenderer

Bases: BaseRecordingRenderer

name = 'html' class-attribute instance-attribute

file_extension = 'html' class-attribute instance-attribute

to_file

Source code in dandy/recorder/renderer/html.py
def to_file(
        self,
        path: Path | str
):
    Path(path).mkdir(parents=True, exist_ok=True)

    with open(
            Path(path, f'{self.recording.name}{RECORDING_POSTFIX_NAME}.html'),
            'w',
            encoding='utf-8'
    ) as new_file:
        new_file.write(self.to_str())

to_str

Source code in dandy/recorder/renderer/html.py
def to_str(self) -> str:
    return self._render_base_html_template_to_str()