class documentation
class MarkdownDocument(_GenericDocumentOutput): (source)
Constructor: MarkdownDocument(file_path)
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 |
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 |
A markdown heading. |
Method | string |
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 to the file. |
Instance Variable | tags |
List of tags for elements that are allowed. |
Instance Variable | tags |
List of tags for elements that are excluded. |
Method | _not |
Handler for not implemented elements. |
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.DataFrame | The table in form of a pandas.DataFrame . |
caption:str | Caption string realized as Subtitle paragraph. |
note:str | (Not implemented yet). |
autofit:bool | Ignored because not relevant for markdown. |
decimalint | Ignored in current implementation. |
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 | |
imagebytes | The image as bytes. |
scalefloat | The factor to scale that image. |
caption:str | The caption string. |
Start the conversion of the Report
into a markdown file.
Parameters | |
report:Report | The report object. |
Returns | |
_GenericDocumentOutput | Itself. |