Skip to content

markdown

dandy.recorder.renderer.markdown

MarkdownRecordingRenderer

Bases: BaseRecordingRenderer

name = 'markdown' class-attribute instance-attribute

file_extension = 'md' class-attribute instance-attribute

to_file

Source code in dandy/recorder/renderer/markdown.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}.md'),
            'w',
            encoding='utf-8'
    ) as new_file:
        new_file.write(
            self.to_str()
        )

to_str

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