class documentation

Export a Report into a markdown document.

In some special situations HTML tags are used for some elements.

Method __init__ Initiate the document.
Method dataframe_to_table Markdown output of a table element.
Method image Convert Report.Image element into extern file.
Method save Start the conversion of the Report into a markdown file.
Method string_to_heading A markdown heading.
Method string_to_paragraph Add paragraph.
Instance Variable _mdfile Undocumented

Inherited from _GenericDocumentOutput:

Method show Open the generated document with the file type associated application.
Instance Variable file_path Path to the file.
Instance Variable tags_allowed List of tags for elements that are allowed.
Instance Variable tags_excluded List of tags for elements that are excluded.
Method _not_implemented Handler for not implemented elements.
def __init__(self, file_path: pathlib.Path): (source)

Initiate the document.

Parameters
file_path:pathlib.PathPath to the output file.
def dataframe_to_table(self, df: pandas.DataFrame, caption: str, note: str, autofit: bool, decimal_places: int = 2): (source)

Markdown output of a table element.

Parameters
df:pandas.DataFrameThe table in form of a pandas.DataFrame.
caption:strCaption string realized as Subtitle paragraph.
note:str(Not implemented yet).
autofit:boolIgnored because not relevant for markdown.
decimal_places:intIgnored in current implementation.
def image(self, image_bytes: bytes, scale_factor: float, caption: str): (source)

Convert Report.Image element into extern file.

All images are stored in a sub-folder. It's name is build from the output filename base and the suffix _images. The filename of an image is build from its caption or if not present with random characters.

The original image data is not scaled. Scaling is realized via the width attribute in an <img /> tag.

Parameters
image_bytes:bytesThe image as bytes.
scale_factor:floatThe factor to scale that image.
caption:strThe caption string.
def save(self, report: Report) -> _GenericDocumentOutput: (source)

Start the conversion of the Report into a markdown file.

Parameters
report:ReportThe report object.
Returns
_GenericDocumentOutputItself.
def string_to_heading(self, text: str, level: int): (source)

A markdown heading.

def string_to_paragraph(self, text: str, style: str): (source)

Add paragraph.

If style is Subtitle then the paragraph is encapsulated by <sub> tag.

Undocumented